step_AIC {MASSExtra} | R Documentation |
Stepwise model construction and inspection
Description
Front-ends to stepAIC
and dropterm
with changed defaults.
step_BIC
implements a stepwise selection with BIC as the criterion and
step_GIC
uses an experimental criterion with a penalty midway between AIC and BIC: the
"Goldilocks" criterion.
Usage
step_AIC(object, ..., trace = 0, k = 2)
step_BIC(object, ..., trace = 0, k = max(2, log(nobs(object))))
step_GIC(object, ..., trace = 0, k = (2 + log(nobs(object)))/2)
drop_term(
object,
...,
test = default_test(object),
k,
sorted = TRUE,
decreasing = TRUE,
delta = TRUE
)
add_term(
object,
...,
test = default_test(object),
k,
sorted = TRUE,
decreasing = TRUE,
delta = TRUE
)
Arguments
object |
as for |
... |
additional arguments passed on to main function in |
trace , k |
as for |
sorted , test |
|
decreasing |
in |
delta |
Should the criterion be displayed (FALSE) or the change in the in the criterion relative to the present model (TRUE)? |
Value
A fitted model object after stepwise refinement, or a data frame with extra class membership for single term functions.
Examples
fm <- glm.nb(Days ~ .^3, quine)
drop_term(fm_aic <- step_AIC(fm))
drop_term(fm_bic <- step_BIC(fm))
[Package MASSExtra version 1.2.2 Index]