Displaying 1 result from an estimated 1 matches for "steplm".
Did you mean:
step
2006 Nov 12
0
forward variable selection using function step
...houldn't X_p:X_q be the same as X_q:X_p? So why am I getting
this error message? Any help is greatly appreciated.
> x1<-rnorm(100,0,1)
> x2<-rnorm(100,0,1)
> x3<-rnorm(100,0,1)
> y<-x1+x2+2*x3+2*x1*x3+rnorm(100,0,1)
> datasim<-data.frame(cbind(y,x1,x2,x3))
>
steplm<-step(lm(y~1,data=datasim),scope=list(upper=~x1*x2*x3,lower=~1),direction="forward",trace=1)
Start: AIC= 274.81
y ~ 1
Df Sum of Sq RSS AIC
+ x3 1 615.97 914.34 225.30
+ x1 1 139.97 1390.34 267.21
+ x2 1 83.42 1446.90 271.20
<none>...