step.lmrobdetMM {RobStatTM} | R Documentation |
Robust stepwise using RFPE
Description
This function performs stepwise model selection on a robustly fitted
linear model using the RFPE
criterion and the robust regression estimators computed with
lmrobdetMM
. Only backwards stepwise is currently implemented.
Usage
step.lmrobdetMM(
object,
scope,
direction = c("both", "backward", "forward"),
trace = TRUE,
keep = NULL,
steps = 1000,
whole.path = FALSE
)
Arguments
object |
a robust fit as returned by |
scope |
either a formula or a list with elements |
direction |
the direction of stepwise search. Currenly only |
trace |
logical. If |
keep |
a filter function whose input is a fitted model object and the associated AIC statistic, and whose output is arbitrary. Typically keep will select a subset of the components of the object and return them. The default is not to keep anything. |
steps |
maximum number of steps to be performed. Defaults to 1000, which should mean as many as needed. |
whole.path |
if |
Details
Presently only backward stepwise selection is supported. During each step the
Robust Final Prediction Error (as computed by the function lmrobdetMM.RFPE
) is
calculated for the current model and for each sub-model achievable by deleting a
single term. If the argument whole.path
is FALSE
, the function 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. If the argument whole.path
is TRUE
, the
function steps through all smaller submodels removing, at each step, the variable
that most reduces the Robust Final Prediction Error. The scale estimate from object
is used to compute the Robust Final Prediction Error throughout the procedure.
Value
If whole.path == FALSE
the function returns the robust fit as obtained by lmrobdetMM
using the final model.
If whole.path == TRUE
a list is returned containing the RFPE of each model on the sequence
of submodels. The names of the components of this list are the formulas that correspods to each model.
Author(s)
Victor Yohai, victoryohai@gmail.com, Matias Salibian-Barrera, matias@stat.ubc.ca
References
http://www.wiley.com/go/maronna/robust
See Also
Examples
cont <- lmrobdet.control(bb = 0.5, efficiency = 0.85, family = "bisquare")
set.seed(300)
X <- matrix(rnorm(50*6), 50, 6)
beta <- c(1,1,1,0,0,0)
y <- as.vector(X %*% beta) + 1 + rnorm(50)
y[1:6] <- seq(30, 55, 5)
for (i in 1:6) X[i,] <- c(X[i,1:3],i/2,i/2,i/2)
Z <- cbind(y,X)
Z <- as.data.frame(Z)
obj <- lmrobdetMM(y ~ ., data=Z, control=cont)
out <- step.lmrobdetMM(obj)