

Hi ,

I want to apply the following code fo my data with 400 predictors.
I was wondering if there ia an alternative way instead of typing 400 predictors for the following code.
I really appreciate your help.

fit0<-lm(Y~1, data= mydata)
fit.final<- lm(Y~X1+X2+X3+.....+X400, data=mydata) ???
step(fit0, scope=list(lower=fit0, upper=fit.final), data=mydata, direction="forward")
step(fit.final, scope=list(lower=fit.final, upper=fit0), data=mydata, direction="backward")
 
Best,Farnoosh Sheikhi
	[[alternative HTML version deleted]]

