plot.lmfm: Comparison Diagnostic Plots for Linear Regression Models

Description Usage Arguments Details Value Side Effects References See Also Examples

View source: R/plot.lmfm.q

Description

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

(2)

Normal QQ Plot of Modified Residuals,

(3)

Kernel Density Estimate of Modified Residuals,

(4)

Modified Residuals vs. Leverage,

(5)

Modified Residuals vs. Fitted Values,

(6)

Scale-Location,

(7)

Response vs. Fitted Values,

(8)

Modified Residuals vs. Index (Time),

(9)

Overlaid Normal QQ Plot of Modified Residuals,

(10)

Overlaid Kernel Density Estimate of Modified Residuals,

(11)

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

Usage

1
2
## S3 method for class 'lmfm'
plot(x, which.plots = c(5, 2, 6, 4),  ...)

Arguments

x

an lmfm object.

which.plots

either "ask", "all", or a vector of integer values specifying which plots to draw. In the latter case, use the plot numbers given in the description above (or in the "ask" menu). Any other values will be silently ignored.

...

other parameters to be passed through to plotting functions.

Details

The modified residuals are defined to be

r_{i} = \frac{e_{i}}{√{1 - h_{i}}}

where h_{i} = H_{ii} is the i^{th} diagonal element of the hat matrix. The modified residuals are identically distributed with variance σ^{2}. The modified residuals are used instead of the standardized residuals (which are identically distributed with variance 1) so that the comparison plots emphasize differences in the variance estimates.

Value

x is invisibly returned.

Side Effects

The selected plots are drawn on a graphics device.

References

Atkinson, A. C. 1985. Plots, transformations, and regression: an introduction to graphical methods of diagnostic regression analysis. Oxford: Clarendon Press.

See Also

See qqPlot.lmfm for (2), kernDenPlot.lmfm for (3), indexPlot.lmfm for (8), overlaidQQPlot.lmfm for (9), overlaidKernDenPlot.lmfm for (10), simpleRegPlot.lmfm for (11), and scatterPlot.lmfm for the others. See rmodified for modified residuals.

Examples

1
2
3
4
5
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)

Example output



fit.models documentation built on May 2, 2019, 4:44 p.m.