lmrob(formula, data, subset, weights, na.action, method = "MM",
model = TRUE, x = !control$compute.rd, y = FALSE,
singular.ok = TRUE, contrasts = NULL, offset = NULL,
control = NULL, ...)as.data.frame to a data frame) containing
the variables in the model. If not found in data, the
variablNAs. The default is set by
the na.action setting of options, and is
MM
is interpreted as SM. See Details.TRUE the corresponding
components of the fit (the model frame, the model matrix, the
response) are returned.FALSE (the default in S but
not in R) a singular fit is an error.contrasts.arg
of model.matrix.default.offset term can be included in the
formula instead or as well, and ilist specifying control parameters; use
the function lmrob.control(.) and see its help page.control.lmrob. A list that includes the
following components:lmrob.S (for
MM-estimates onlyTRUE if the IRWLS iterations have convergedlmrob.fit().
The argument setting of lmrob.control is provided
to set alternative defaults as suggested in Koller and Stahel (2011)
(use setting='KS2011'). For details, see
lmrob.control.
As initial estimator it uses an S-estimator (Rousseeuw and Yohai,
1984) which is computed using the Fast-S algorithm of Salibian-Barrera
and Yohai (2006), calling the function lmrob.S. The
following chain of estimates is customizable via the method
argument of lmrob.control. There are currently two types
of estimates available: M and D. The first corresponds
to the standard M-regression estimate. D stands for the Design
Adaptive Scale estimate as proposed in Koller and Stahel (2011). The
method argument takes a string that specifies the estimates to
be calculated as a chain. Setting method='SMDM' will result in
an intial S-estimate, followed by an M-estimate, a Design Adaptive
Scale estimate and a final M-step. For methods involving a
D-step, the default psi value of psi is changed to lqq.
By default, standard errors are computed using the formulas of Croux,
Dhaene and Hoorelbeke (2003) (lmrob.control option
cov=".vcov.avar1"). This method, however, works only for
MM-estimates. For other method arguments, the covariance matrix
estimate used is based on the asymptotic normality of the estimated
coefficients (cov=".vcov.w") as described in Koller and Stahel
(2011).lmrob.control;
for the algorithms lmrob.S and lmrob.fit;
and for methods,
predict.lmrob, summary.lmrob,
print.lmrob, and plot.lmrob.data(coleman)
summary( m1 <- lmrob(Y ~ ., data=coleman) )
summary( m2 <- lmrob(Y ~ ., data=coleman, setting = 'KS2011') )
data(starsCYG, package = "robustbase")
## Plot simple data and fitted lines
plot(starsCYG)
lmST <- lm(log.light ~ log.Te, data = starsCYG)
(RlmST <- lmrob(log.light ~ log.Te, data = starsCYG))
abline(lmST, col = "red")
abline(RlmST, col = "blue")
summary(RlmST)
vcov(RlmST)
stopifnot(all.equal(fitted(RlmST),
predict(RlmST, newdata = starsCYG),
tol = 1e-14))Run the code above in your browser using DataLab