 / Home
 influence Residuals and influence for regression
DESCRIPTION
Computes leverage, studentized and standardized residuals, dfbetas and Cook's distance for a linear model, generalized linear model or generalized additive model.

USAGE
inf <- influence(lm.obj)
plot.t(inf)
plot.d(inf)

REQUIRED ARGUMENTS
 lm.obj object of class lm or which inherits from lm.

plot.t and plot.d take as argument the output of influence, which is a dataframe with named columns.

VALUE
influence returns a data frame with the following components: h - leverage values, z - studentized residuals, t - externally studentized residuals, d - Cook's distance. There is also one component for each term in the linear model giving the dfbetas.

SIDE EFFECTS
plot.t plots the externally studentized residuals, together with Bonferroni simultaneous 95% confidence bands. plot.d plots the Cook's distances.

DETAILS
The leverages h measure how unusual are the x-values for each observation, i.e., the potential of that point to be influential.

The studentized residuals z are approximately standard normal residuals, while the externally studentized residuals t are score test statistics for testing each point an outlier. Any point whose externally studentized residuals extends beyond the confidence bands is formally judged to be an outlier at the 5% level.

Cook's distance measures the overall influence of each observation on the regression coefficients, including the intercept. The dfbetas measure the influence of each observation on each of the individuals regression coefficients, excluding the intercept. Specifically the dfbetas are the number of standard errors by which the coefficient changes when that observation is added to the regression. Cook's distance is roughly the average of the squares of the dfbetas.

The results for generalized linear models and generalized additive models are approximate.

REFERENCES
Hamilton, L. C. (1992). Regression with graphics. Duxbury, Belmont, CA.
Weisberg, S. (1985). Applied linear regression, 2nd Edition. Wiley, New York.

EXAMPLES
lm.yx <- lm(y~x)
inf <- influence(lm.yx)
plot.t(inf)
plot.d(inf)