Learn R Programming

robustbase (version 0.5-0-1)

plot.lmrob: Plot Method for "lmrob" Objects

Description

Diagnostic plots for elements of class lmrob

Usage

## S3 method for class 'lmrob':
plot(x, which = 1:5,
     caption = c("Standardized residuals vs. Robust Distances",
   "Normal Q-Q vs. Residuals", "Response vs. Fitted Values",
   "Residuals vs. Fitted Values" , "Sqrt of abs(Residuals) vs. Fitted Values"),
   panel = points, sub.caption = deparse(x$call), main = "",
   compute.MD = TRUE,
   ask = prod(par("mfcol")) < length(which) && dev.interactive(),
   ..., p=0.025)

Arguments

x
an object as created by lmrob
which
integer number between 1 and 5 to specify which plot is desired
caption
Caption for the different plots
panel
Panel
main
Main title
sub.caption
sub titles
compute.MD
logical indicating if the robust Mahalanobis distances should be recomputed, using covMcd() when needed, i.e., if which contains 1.
ask
waits for user input before displaying each plot
...
optional arguments for par
p
threshold for distance-distance plot

Details

if compute.MD = TRUE and the robust Mahalanobis distances need to be computed, they are stored (cached) with the object x when this function has been called from top-level.

References

Robust diagnostic plots as in Rousseuw and van Zomeren (1990)

See Also

lmrob, also for examples, plot.lm.

Examples

Run this code
data(starsCYG)
## Plot simple data and fitted lines
plot(starsCYG)
 lmST <-    lm(log.light ~ log.Te, data = starsCYG)
RlmST <- lmrob(log.light ~ log.Te, data = starsCYG)
RlmST
abline(lmST, col = "red")
abline(RlmST, col = "blue")

op <- par(mfrow = c(2,2), mgp = c(1.5, 0.6, 0), mar= .1+c(3,3,3,1))
plot(RlmST, which = c(1:2, 4:5))
par(op)

Run the code above in your browser using DataLab