fit.models (version 0.64)

plot.lmfm: Comparison Diagnostic Plots for Linear Regression Models

Description

Produces a set of comparison diagnostic plots. The plot options are

  1. Normal QQ Plot of Residuals,

  2. Kernel Density Estimate of Residuals,

  3. Residuals vs. Mahalanobis Distance,

  4. Residuals vs. Fitted Values,

  5. Sqrt Residuals vs. Fitted Values,

  6. Response vs. Fitted Values,

  7. Residuals vs. Index (Time),

  8. Overlaid Normal QQ Plot of Residuals,

  9. Overlaid Kernel Density Estimate of Residuals,

  10. Scatter Plot with Overlaid Fits (for simple linear regression models).

Usage

# S3 method for lmfm
plot(x, which.plots = 1:10, ...)

Arguments

x

an lmfm object.

which.plots

either "ask" (character string) or an integer vector specifying which plots to draw. In the later case, the plot numbers are given above.

additional parameters are ignored.

Value

x is invisibly returned.

Side Effects

The selected plots are drawn on a graphics device.

See Also

See sideBySideQQPlot for 2, sideBySideKernelDensityPlot for 3, sideBySideIndexPlot for 8, overlaidQQPlot for 9, overlaidKernelDensityPlot for 10, overlaidSimpleRegressionPlot for 11, and sideBySideScatterPlot for the others.

Examples

Run this code
# NOT RUN {
data(stackloss)
stack.lm <- lm(stack.loss ~ ., data = stackloss)
stack.clean <- lm(stack.loss ~ ., data = stackloss, subset = 5:20)
fm <- fit.models(stack.clean, stack.lm)
plot(fm)
# }

Run the code above in your browser using DataLab