stepwise {mimR} | R Documentation |
Functions to do stepwise model selection in MIM to achieve a new model object.
## S3 method for class 'mim': stepwise(object, arg = NULL, critlevel=NULL, infconstant=NULL,...)
object |
A mimModel object |
arg |
Stepwise options to MIM |
critlevel |
Set the critical level for the model selection. Default is 0.05 |
infconstant |
Penalizing parameter used when model selection in based on information criteria, see 'details' below. |
... |
Additional arguments, currently not used |
Setting arg to contain "A" leads to model selection by AIC, i.e. the model with the smallest value of -2log Q - 2 * p is choosen. With BIC, the model with the smallest value of -2log Q - log(n) * p is chosen. Setting infconstant to some value k AND setting arg to contains "A" will lead to selecting the model with the smallest value of -2log Q - k * p.
A mim model object
Before using mimR, make sure that the MIM program is runnning.
Søren Højsgaard, sorenh@agrsci.dk
David Edwards, An Introduction to Graphical Modelling, Springer Verlag, 2002
data(carcass) gmd.carc <- as.gmData(carcass) m.main <- fit(mim(".", data=gmd.carc)) m.sat <- fit(mim("..", data=gmd.carc)) m.main <- mim(".", data=gmd.carc) m.sat <- mim("..", data=gmd.carc) m.m <- stepwise(m.main, "f") # forward m.s <- stepwise(m.sat, "s") # backward, exact tests