On Apr 6, 2014, at 6:07 PM, Kristi Glover wrote:
Hi R users,
I was trying to plot with a fixed y with many independet variables.
It looks like you are plotting with a fixed x.
I tried this loop but it did not work. any suggestions?
Yes. Explain what "did not work" means. Error? Then post the error
message. Different results than expected? Then describe.
I wanted to make 9 plots. This is a just an example data.
dat1<- as.data.frame(matrix(sample(1:20,100,replace=TRUE),ncol=10))
lapply(seq_len(ncol(dat1)),function(i)
{
par(mfrow=c(3,3)),
plot(dat1[,1],dat1[,i+1],
z[,i]<-lm(dat1[,1]~dat1[,i+1]),
What were you expecting to happen to "dat1[,i+1]" when "i" was at its
max?
abline(z),
summary(z[,i])
}
here first column is dependent variable and other V2 to V10s are
independent variables. Also wanted look the summary (linear model)
with each variable.
Thanks for your suggestions
KG
===
Please post in plain text.
[[alternative HTML version deleted]]
--
David Winsemius, MD
Alameda, CA, USA
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.