powered by
A simple facility to refine models by backward elimination. Covers cases where drop_term works but step_AIC does not
drop_term
step_AIC
step_down(object, ..., trace = FALSE, k)
A refined fitted model object
A fitted model object
additional arguments passed to drop_term such as k
k
logical: do you want a trace of the process printed?
penalty (default 2, as for AIC)
fm <- lm(medv ~ . + (rm + tax + lstat)^2 + I((rm - 6)^2) + I((tax - 400)^2) + I((lstat - 12)^2), Boston) sfm <- step_down(fm, trace = TRUE, k = "bic")
Run the code above in your browser using DataLab