Choose a model by AIC in a Stepwise Algorithm
Select a formula-based model by AIC.
step4(object, ...)
step4vglm(object, scope, direction = c("both", "backward", "forward"),
trace = 1, keep = NULL, steps = 1000, k = 2, ...)... |
any additional arguments to
|
This function is a direct adaptation of
step
for vglm-class objects.
Since step is not generic,
the name step4() was adopted
and it is generic, as well as being S4 rather than S3.
It is the intent that this function should work as similar as
possible to step.
Internally, the methods function for vglm-class
objects calls add1.vglm and
drop1.vglm
repeatedly.
The results are placed in the post slot of the
stepwise-selected model that is returned.
There are up to two additional components.
There is an "anova"
component corresponding to the steps taken in the search,
as well as a "keep" component if the keep= argument
was supplied in the call.
In general,
the same warnings in
drop1.glm and
drop1.vglm
apply here.
This function
data("backPain2", package = "VGAM")
summary(backPain2)
fit1 <- vglm(pain ~ x2 + x3 + x4 + x2:x3 + x2:x4 + x3:x4,
propodds, data = backPain2)
spom1 <- step4(fit1)
summary(spom1)
spom1@post$anovaPlease choose more modern alternatives, such as Google Chrome or Mozilla Firefox.