[R] stepAIC problem
Bernardo Rangel Tura
tura at centroin.com.br
Sun Oct 12 12:13:51 CEST 2003
At 09:46 05-10-2003, Hiroto Miyoshi wrote:
>Dear R-users
>
>I have a probelm running stepAIC in R1.7.1
>(...)
>--small example
>> library(MASS)
>> x1<-runif(100)
>> x2<-runif(100)
>> x3<-runif(100)
>> x4<-runif(100)
>> x5<-runif(100)
>> y<-x1+x2+x3+runif(100)
>> t<-data.frame(y=y,x1=x1,x2=x2,x3=x3,x4=x4,x5=x5)
>> x<-lm(y~x1+x2+x3+x4+x5,data=t)
>> stepAIC(x)
>Start: AIC= -247.61
> y ~ x1 + x2 + x3 + x4 + x5
>
> Df Sum of Sq RSS AIC
>- x5 1 3.747e-06 7.456 -249.608
>- x4 1 0.026 7.483 -249.254
><none> 7.456 -247.609
>- x1 1 4.866 12.322 -199.375
>- x2 1 8.182 15.639 -175.543
>- x3 1 8.597 16.054 -172.922
>Error in as.data.frame.default(data) : can't coerce function into a
>data.frame
Hiroto,
In My computer with R 1.7.1 e R 1.8.0 (win 98 SE) don´t have this error...
[]s
Tura
More information about the R-help
mailing list