influence.measures
Regression Deletion Diagnostics

Description

Utility functions used to compute regression deletion diagnostics for linear model or generalized linear model.

Usage

influence.measures(model)
## S3 method for class 'infl':
print(x, digits = max(3, getOption("digits") - 4), ...)
## S3 method for class 'infl':
summary(object, digits = max(2, getOption("digits") - 5), ...)

hatvalues(model, ...) ## S3 method for class 'lm': hatvalues(model, infl = lm.influence(model, do.coef = FALSE), ...)

rstandard(model, ...) ## S3 method for class 'lm': rstandard(model, infl = lm.influence(model, do.coef = FALSE), sd = sqrt(deviance(model)/df.residual(model)), ...) ## S3 method for class 'glm': rstandard(model, infl = influence(model, do.coef = FALSE), type = c("deviance", "pearson"), ...)

rstudent(model, ...) ## S3 method for class 'lm': rstudent(model, infl = lm.influence(model, do.coef = FALSE), res = infl$wt.res, ...) ## S3 method for class 'glm': rstudent(model, infl = influence(model, do.coef = FALSE), ...)

dfbeta(model, ...) ## S3 method for class 'lm': dfbeta(model, infl = lm.influence(model, do.coef = TRUE), ...)

dfbetas(model, ...) ## S3 method for class 'lm': dfbetas(model, infl = lm.influence(model, do.coef = TRUE), ...)

dffits(model, infl = lm.influence(model, do.coef = FALSE), res = weighted.residuals(model))

covratio(model, infl = lm.influence(model, do.coef = FALSE), res = weighted.residuals(model))

cooks.distance(model, ...) ## S3 method for class 'lm': cooks.distance(model, infl = lm.influence(model, do.coef = FALSE), res = weighted.residuals(model), sd = sqrt(deviance(model)/df.residual(model)), hat = infl$hat, ...) ## S3 method for class 'glm': cooks.distance(model, infl = influence(model, do.coef = FALSE), res = infl$pear.res, dispersion = summary(model)$dispersion, hat = infl$hat, ...)

Arguments

model a linear model or generalized linear model representing fit. Normally, it is an object of class (or inherited from) "lm" or "glm", returned by function lm or glm.
x, object an object of class "infl", returned by the function influence.measures normally.
digits the number of significant digits to print.
infl an influence structure returned by lm.influence or influence.
sd standard deviation to use in the calculations.
res residual to use in the calculations.
hat the hat values to use in the calculations.
dispersion the dispersion values to use in the calculations.
... other arguments pass to the functions.

Details

Value
influence.measuresreturns an object of class "infl", which contains the following components:
infmat an influence matrix. It contains the dfbetas for each model term, dffits, covariance ratios, cooks distances, and hat values.
is.inf a logical matrix to indicate which element of infmat is influential.
call a matched call of model frame.
hatvaluesreturns the diagonal values of the hat matrix for model. Its method hatvalues.lm extracts the hat value from an infl structure, which is generated by the lm.influence function.
rstandardgeneric. Methods rstandard.lm and rstandard.glm return the standardized residuals for linear and generalized linear models, respectively.
rstudentgeneric. Methods rstudent.lm and rstudent.glm return the studentized residuals for linear and generalized linear models, respectively.
dfbetareturns a matrix containing the differences in regression coefficients. (The i-th row shows the change in coefficients from omitting the i-th observation from the model.)
dfbetasreturns a standardized version of dfbeta.
dffitsreturns the standardized change in fitted values from omitting the i-th observation from the model.
covratioreturns a measure of the change in the covariance of the coefficients from omitting the i-th observation from the model.
cooks.distancereturns the cooks distance for the model.
References
Belsley, D. A., Kuh, E., and Welsch, R. E. 1980. Regression Diagnostics. New York, NY: John Wiley & Sons.
Cook, R. D. and Weisberg, S. 1982. Residuals and Influence in Regression. London, UK: Chapman and Hall.
Fox, J. 1997. Applied Regression, Linear Models, and Related Methods. Thousand Oaks, CA: Sage Publications. http://www.socsci.mcmaster.ca/jfox/Books/Companion/.
Fox, J. 2002. An R and S-Plus Companion to Applied Regression. Thousand Oaks, CA: Sage Publications. http://www.socsci.mcmaster.ca/jfox/Books/Companion/.
Williams, D. A. 1987. Generalized linear model diagnostics using the deviance and single case deletions. Applied Statistics. Volume 36. 181-191.
See Also
lm, glm, lm.influence, influence
Examples
numdead <- c(1, 4, 9, 13, 18, 20, 0, 2, 6, 10, 12, 16)
ldose <- rep(0:5, 2)
sex <- factor(rep(c("M", "F"), c(6, 6)))
SF <- cbind(numdead, numalive = 20 - numdead)
bwormGlm <- glm(SF ~ ldose + sex + ldose:sex, family = binomial)
summary(bwormGlm)
infl <- influence.measures(bwormGlm)
print(infl)
summary(infl)

hatvalues(bwormGlm) rstandard(bwormGlm) rstudent(bwormGlm) dfbeta(bwormGlm) dfbetas(bwormGlm) dffits(bwormGlm) covratio(bwormGlm) cooks.distance(bwormGlm)

Package stats version 6.1.4-13
Package Index