Learn R Programming

DAAG (version 1.17)

lmdiags: Return data required for diagnostic plots

Description

This extracts the code that provides the major part of the statistical information used by plot.lm, leaving out the code used to provide the graphs

Usage

lmdiags(x, which = c(1L:3L, 5L), cook.levels = c(0.5, 1))

Arguments

x
This must be an object of class lm object, or that inherits from an object of class lm.
which
a subset of the numbers '1:6', indicating the plots for which statistical information is required
cook.levels
Levels for contours of cook.levels, by default c(0.5,1)

Value

  • yhfitted values
  • rsstandardized residuals (for glm models standardized deviance residuals)
  • yhn0As yh, but omitting observations with zero weight
  • cookCook's statistics
  • hiiDiagonal elements of the hat matrix
  • rspstandardized residuals (for glm models standardized Pearson residuals)

Details

See plot.lm for additional information.

References

See references for plot.lm

See Also

plotSimDiags.lm, plot.lm

Examples

Run this code
women.lm <- lm(weight ~ height, data=women)
veclist <- lmdiags(x=women.lm)
## Returns the statistics that are required for graphs 1, 2, 3, and 5

Run the code above in your browser using DataLab