[R] Package to make stepwise model selection using F or Chisq test

Ronaldo Reis Junior chrysopa at gmail.com
Thu Nov 15 12:55:44 CET 2007


Hi,

I looking for a method that use F or Chisq test instead of AIC in a stepwise 
modelo selection.

I try the grasp package using the grasp.step.anova, but It dont work.

> library(grasp)
Carregando pacotes exigidos: gam
Carregando pacotes exigidos: splines
Carregando pacotes exigidos: mda
Carregando pacotes exigidos: class

> data(anorexia,package="MASS")
> 
> m1 <- glm(Postwt ~ Prewt * Treat,data=anorexia)
> 
> m1.grasp <- grasp.step.anova(m1,scope=list(upper=~ Prewt * 
Treat,lower=~1),trace=1,direction="both")
# 
# FUNCTION: grasp.step.anova 
# (by Splus, adapted by A. Lehmann from step.gam) 
# grasp.step.anova is a modified version of step.gam of Splus using ANOVA 
based on Chi or F tests instead  
# of AIC criteria 
# 
Erro em grasp.step.anova(m.pres, scope = list(upper = ~(ProfSer + NgalhoSer 
+  : 
  objeto "OPTIONS" não encontrado

Looking for OPTIONS in the code I found that this need a P.limit in an OPTIONS 
object. I make it.

> OPTIONS <- NULL
> OPTIONS$P.limit <- 0.05

> m.pres.step <- 
grasp.step.anova(m.pres,scope=list(upper=~(ProfSer+NgalhoSer+CTOTAL+DensRamos+Htotal+CAP)^3,lower=~1),trace=1,direction="both")
# 
# FUNCTION: grasp.step.anova 
# (by Splus, adapted by A. Lehmann from step.gam) 
# grasp.step.anova is a modified version of step.gam of Splus using ANOVA 
based on Chi or F tests instead  
# of AIC criteria 
# 
Erro em untangle.scope(object$terms, scope) : 
  The elements of a regimen 1 appear more than once in the initial model
> 

Dont work and grasp manual is incomplete.

Anybody know other package to make this?

Thanks
Ronaldo
--
> Prof. Ronaldo Reis Júnior
|  .''`. UNIMONTES/Depto. Biologia Geral/Lab. de Biologia Computacional
| : :'  : Campus Universitário Prof. Darcy Ribeiro, Vila Mauricéia
| `. `'` CP: 126, CEP: 39401-089, Montes Claros - MG - Brasil
|   `- Fone: (38) 3229-8187 | ronaldo.reis em unimontes.br | chrysopa em gmail.com
| http://www.ppgcb.unimontes.br/ | ICQ#: 5692561 | LinuxUser#: 205366



More information about the R-help mailing list