[R] Forward stepwise procedure w/ stepAIC
Spencer Graves
spencer.graves at pdf.com
Wed Jun 18 16:21:51 CEST 2003
What's "m1"? Is it a fit to a ~1? I've used my own modification of
stepAIC many times preceeded by "m1 <- lm(y~1, data=...)", and it has
worked fine for me.
hth. spencer graves
MZodet at ahrq.gov wrote:
> I'm attempting to select a model using stepAIC. I want to use a forward
> selection procedure. I have specified a "scope" option, but must not be
> understanding how this works. My results indicate that the procedure begins
> and ends with the "full" model (i.e., all 17 independent variables)...not
> what I expected. Could someone please point out what I'm not understanding?
> My code is below.
>
>
>
> Thanks.
>
>
>
> Marc
>
>
>
>
>>m1.stepFwd <- stepAIC(m1, direction="forward",
>
>
> + scope=list(upper=~age.refc.fo + dusz.cat.fo +
>
> + ed.du.f + emp.ref.f + geodist3.f + has.fone.f +
>
> + healthdu.f + help.du.f + inc.ref.f + maj.act.f +
>
> + marryref.f + msa.stat.f + regionrf.f + r.e.ref.f +
>
> + sex.ref.f + type.psu.f + urb.stat.f, lower=~1))
>
> Start: AIC= 4752.19
>
> response ~ age.refc.fo + dusz.cat.fo + ed.du.f + emp.ref.f +
>
> geodist3.f + has.fone.f + healthdu.f + help.du.f + inc.ref.f +
>
> maj.act.f + marryref.f + msa.stat.f + regionrf.f + r.e.ref.f +
>
> sex.ref.f + type.psu.f + urb.stat.f
>
>
>
>
>
>>m1.stepFwd$anova
>
>
> Stepwise Model Path
>
> Analysis of Deviance Table
>
>
>
> Initial Model:
>
> response ~ age.refc.fo + dusz.cat.fo + ed.du.f + emp.ref.f +
>
> geodist3.f + has.fone.f + healthdu.f + help.du.f + inc.ref.f +
>
> maj.act.f + marryref.f + msa.stat.f + regionrf.f + r.e.ref.f +
>
> sex.ref.f + type.psu.f + urb.stat.f
>
>
>
> Final Model:
>
> response ~ age.refc.fo + dusz.cat.fo + ed.du.f + emp.ref.f +
>
> geodist3.f + has.fone.f + healthdu.f + help.du.f + inc.ref.f +
>
> maj.act.f + marryref.f + msa.stat.f + regionrf.f + r.e.ref.f +
>
> sex.ref.f + type.psu.f + urb.stat.f
>
>
>
>
>
> Step Df Deviance Resid. Df Resid. Dev AIC
>
> 1 NA NA 5311 4660.192 4752.192
>
>
>
>
>
>
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
More information about the R-help
mailing list