plot.lm
, for simulated data. By default, simulated data
are for the fitted model. Alternatively, simulated data can be
supplied, making it possible to check the effct of fitting, e.g.,
an AR1 model.## S3 method for class 'lm':
plotSimDiags(obj, simvalues = NULL, seed = NULL,
types = NULL, which = c(1:3, 5), layout = c(4, 1), qqline=TRUE,
cook.levels = c(0.5, 1), 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]))),
...)
lm
or an object inheriting from lm
"p"
or c("p","smooth")
or
(which=2
, which=6
) NULL or (which=4
) "h"plot.lm
layout=c(3,4)
will give 12 plots in a 3 by 4 layout.which
. List elements for which a graphics object is not
returned are set to NULL. Or if which
is of length 1,
a lattice graphics object.which=c(1:3,5)
, list items 1, 2, 3 and 5 above
contain graphics objects, with list elements 4 and 6 set to NULL
.plot.lm
women.lm <- lm(height ~ weight, data=women)
gphlist <- plotSimDiags(obj=women.lm, which=c(1:3,5))
Run the code above in your browser using DataLab