[R] saving AIC of intermediate models in step

Adaikalavan Ramasamy ramasamy at cancer.org.uk
Wed Nov 30 13:17:02 CET 2005


df           <- data.frame( matrix( rnorm(1000), nc=10 ) )
colnames(df) <- c("y", paste("x", 1:9, sep=""))
ifit         <- glm( y ~ ., data=df ) # initial fit

a <- stepAIC( ifit, keep=extractAIC )
a$keep
        [,1]     [,2]     [,3]     [,4]     [,5]     [,6]     [,7]
[1,]  10.000   9.0000   8.0000   7.0000   6.0000   5.0000   4.0000
[2,] 319.356 317.3819 315.4327 314.3526 313.2192 312.3311 311.1450
         [,8]     [,9]    [,10]
[1,]   3.0000   2.0000   1.0000
[2,] 310.2517 309.1266 308.1171


On Tue, 2005-11-29 at 19:01 +0100, german.lopez at ua.es wrote:
> Hi all,
>   I'm fitting GLM's using the step or stepAIC procedures and I would 
> like to save the AIC of the intermediate models. I would appreciate 
> very much information about how todo this.
>   Best wishes
>   GermÃ¡n LÃ³pez
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list