Skip to content
Prev 246964 / 398502 Next

how to run linear regression models at once

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,
thanks!
+ 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='~'))
fm2<-as.formula(paste('ocbo',ms[i],sep'~'"