step.lmRob(object, scope, scale,
direction = c("both", "backward", "forward"),
trace = TRUE, keep = NULL, steps = 1000, fast = FALSE, ...)
lmRob
object.lower
and upper
each of which is a formula. The terms in the right-hand-side of lower
are always included in the model and the additional terms in the right-hand-side of object
is used.TRUE
, information is printed during stepwise search.TRUE
the robust initial estimate (used when fitting each of the reduced models) is replaced by a weighted least squares estimate using the robust weights computed for the current fit. Note: the fast algorithm does not woanova
element corresponding to the steps taken in the search is appended to the returned object. If a keep
function was provided then the kept values can be found in the keep
element of the returned object.lmRob.RFPE
) is calculated for the current model and for each sub-model achievable by deleting a single term. The function then either steps to the sub-model with the lowest Robust Final Prediction Error or, if the current model has the lowest Robust Final Prediction Error, terminates. The scale estimate from object
is used to compute the Robust Final Prediction Error throughout the procedure unless the scale
argument is provided in which case the user specified value is used.lmRob
,
lmRob.RFPE
,
add1.lmRob
, drop1.lmRob
.data(stack.dat)
stack.rob <- lmRob(Loss ~ ., data = stack.dat)
## The default behavior is to try dropping all terms ##
step.lmRob(stack.rob)
## Keep Water.Temp in the model ##
my.scope <- list(lower = . ~ Water.Temp, upper = . ~ .)
step.lmRob(stack.rob, scope = my.scope)
Run the code above in your browser using DataLab