Description Usage Arguments Details Value See Also Examples
This function leverages code from the plot.lm
function
from the stats library. It allows for the same imput (except when
related directly to 'par' functionality, which makes no sense to include).
We also include "newer" functionality.
1 2 3 4 5 6 7 8 9 10 | ggDiagnose.lm(x, which = c(1L:3L, 5L),
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]))),
sub.caption = NULL, main = NULL, ..., id.n = 3,
labels.id = factor(names(stats::residuals(x)), levels =
names(stats::residuals(x))), qqline = TRUE, cook.levels = c(0.5, 1),
show.plot = TRUE, return = FALSE, shape = 1, nrow = min(2,
length(which)), smooth.color = "blue", dashed.color = c("red",
"blue", NA, NA, "red", "black"))
|
x |
|
which |
which plots you'd like to create |
caption |
title per plot |
sub.caption |
caption for bottom of multiple plot visual (defaults to the formula of the model.) |
main |
title for the mulitple plot visual |
... |
extra attributes (currently not used) |
id.n |
id the n observations with largest residuals |
labels.id |
labels for all observations |
qqline |
logic for whether a qqline should be drawn (a line between the 25 and 75 quantiles in the Q-Q plot) |
cook.levels |
levels of cooks distance to visualize in the leverage vs standardized residual graphic |
show.plot |
logic to display the graphics (group of graphics in this case) |
return |
logic to return list of graphics and the data frame to make the majority of graphics |
shape |
shape of points (the default is 1, an open circle) |
nrow |
number of rows in the displayed graphic |
smooth.color |
color for smoothing lines |
dashed.color |
color for dashed line (a vector of length 6 is expected) |
This function can deal with lm
and
glm
objects.
depending on show.plot
and return
it
will return the visualization of the graphics and/or a list
of both the data frame used the make the majority of the graphic and
a list of each individual graphic.
see dfCompile.lm
for data creation.
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.