step_down: Naive backeward elimination

Description Usage Arguments Value Examples

Description

A simple facility to refine models by backward elimination. Covers cases where dropterm works but step_AIC does not

Usage

1
step_down(object, ..., trace = FALSE, k)

Arguments

object

A fitted model object

...

additional arguments passed to dropterm such as k

trace

logical: do you want a trace of the process printed?

k

penalty (default 2, as for AIC)

Value

A refined fitted model object

Examples

1
2
3
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")

BillVenables/WWRUtilities documentation built on Jan. 26, 2021, 10:18 p.m.