plot.lm2 {gplots}R Documentation

Plots to assess the goodness of fit for the linear model objects

Description

Plots to assess the goodness of fit for the linear model objects

Usage

        plot.lm2(x, which = 1:5, caption = c("Residuals vs Fitted",
                 "Normal Q-Q plot", "Scale-Location plot",
                 "Cook's distance plot"), panel = panel.smooth,
                 sub.caption = deparse(x$call), main = "",
                 ask = interactive() && nb.fig < length(which)
                 && .Device != "postscript", ..., id.n = 3,
                 labels.id = names(residuals(x)),
                 cex.id = 0.75, band = TRUE, rug = TRUE)

Arguments

x lm object
which Numerical values between 1 and 5, indicating which plots to be shown. The codes are:
1- fitted vs residuals plot 2- Normal Q-Q plot 3- Scale-Location plot 4- Cook's distance plot 5- residuals vs each predictor plot
caption Caption for each type of plot
panel function to draw on the existing plot
sub.caption SubCaption for the plots
main Main title of the plot
ask whether interactive graphics or postscript
... parameters passed to plot.lm2.
id.n integer value, less than or equal to residuals of lm object
labels.id Names of the residuals of the lm object
cex.id Parameter to control the height of text stringsx
band logical vector indicating whether bandplot should also be plotted
rug logical vector indicating whether rug should be added to the existing plot

Author(s)

Gregory R. Warnes warnes@bst.rochester.edu and Nitin Jain nitin.jain@pfizer.com

Examples

  ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
     trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
     group <- gl(2,10,20, labels=c("Ctl","Trt"))
     weight <- c(ctl, trt)
     x <- lm(weight ~ group)
    plot.lm2(x, which=1)
plot.lm2(x, which=1:3)

[Package gplots version 2.6.0 Index]