gplot.lm | R Documentation |
Six plots (selectable by which
) are currently available: a plot of
residuals against fitted values, a Scale-Location plot of
sqrt(| residuals |) against fitted values, a Normal Q-Q plot, a
plot of Cook's distances versus row labels, a plot of residuals against
leverages, and a plot of Cook's distances against leverage/(1-leverage).
By default, the first three and 5 are provided.
## S3 method for class 'lm'
gplot(
x,
which = c(1L:3L, 5L),
grid = TRUE,
col.grid = "grey90",
col.acc = "white",
caption = list("Residuals vs Fitted", "Normal Q-Q", "Scale-Location",
"Cook's distance", "Residuals vs Leverage", expression("Cook's dist vs Leverage " *
h[ii]/(1 - h[ii]))),
panel = if (add.smooth) panel.smooth else points,
sub.caption = NULL,
main = "",
ask = prod(par("mfcol")) < length(which) && dev.interactive(),
...,
id.n = 3,
labels.id = names(residuals(x)),
cex.id = 0.75,
qqline = TRUE,
cook.levels = c(0.5, 1),
add.smooth = getOption("add.smooth"),
label.pos = c(4, 2),
cex.caption = 1
)
x |
|
which |
a subset of the numbers
See also ‘Details’ below. |
grid |
logical; if |
col.grid |
|
col.acc |
|
caption |
captions to appear above the plots;
|
panel |
panel function. The useful alternative to
|
sub.caption |
common title—above the figures if there are more
than one; used as |
main |
title to each plot—in addition to |
ask |
logical; if |
... |
other parameters to be passed through to plotting functions. |
id.n |
number of points to be labelled in each plot, starting with the most extreme. |
labels.id |
vector of labels, from which the labels for extreme
points will be chosen. |
cex.id |
magnification of point labels. |
qqline |
logical indicating if a |
cook.levels |
levels of Cook's distance at which to draw contours. |
add.smooth |
logical indicating if a smoother should be added to
most plots; see also |
label.pos |
positioning of labels, for the left half and right half of the graph respectively, for plots 1-3, 5, 6. |
cex.caption |
controls the size of |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.