Re: [R] Apply same linear model to subset of dataframe

2012-11-08 Thread Ross Ahmed
ot;, "drat", "gear") IV <- list(c("cyl", "disp", "hp"), c("wt", "qsec"), c("carb")) fits <- vector("list", length(DV)) for(i in seq(DV)) { fit <- lm(formula=paste(DV[i], paste(IV[[i]], collapse="+&

Re: [R] Apply same linear model to subset of dataframe

2012-11-06 Thread Ross Ahmed
Superb Jean, many thanks Ross From: Jean V Adams Date: Tuesday, 6 November 2012 19:20 To: Ross Ahmed Cc: Subject: Re: [R] Apply same linear model to subset of dataframe DV <- c("mpg", "drat", "gear") IV <- list(c("cyl", "disp",

Re: [R] Apply same linear model to subset of dataframe

2012-11-06 Thread Ross Ahmed
Thanks Jean This works for the plots, but it only stores the last lm() computed Ross From: Jean V Adams Date: Tuesday, 6 November 2012 14:12 To: Ross Ahmed Cc: Subject: Re: [R] Apply same linear model to subset of dataframe Ross, Here's one way to condense the code ... DV <

[R] Apply same linear model to subset of dataframe

2012-11-04 Thread Ross Ahmed
esiduals) plotResIV(lm.gear$model[,-1],lm.gear$residuals) Many thanks Ross Ahmed [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www