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="+&
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",
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 <
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
4 matches
Mail list logo