[R] how to run linear regression models at once

wangwallace talenttree at gmail.com
Mon Jan 10 19:29:15 CET 2011

hey, Dennis,

I applied your syntax into my data frame with different variable names.
Specifically, I replaced y1 and y2, with ocbi and ocbo. I got the following
error message. Could you please explain why would this happen? Again,
> for(i in 1:5){fm1<-as.formula(paste('ocbi',ms[i],sep='~'))
+ fm2<-as.formula(paste('ocbo',ms[i],sep'~'))

Error: unexpected string constant in:
"for(i in 1:5){fm1<-as.formula(paste('ocbi',ms[i],sep='~'))
View this message in context: http://r.789695.n4.nabble.com/how-to-run-linear-regression-models-at-once-tp3179256p3207726.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list