Learn R Programming

misty (version 0.6.7)

check.outlier: Statistical Measures for Leverage, Distance, and Influence

Description

This function computes statistical measures for leverage, distance, and influence for linear models estimated by using the lm() function. Mahalanobis distance and hat values are computed for quantifying leverage, standardized leverage-corrected residuals and studentized leverage-corrected residuals are computed for quantifying distance, and Cook`s distance and DfBetas are computed for quantifying influence.

Usage

check.outlier(model, check = TRUE, ...)

Value

Returns a data frame with following entries:

idout

ID variable

mahal

Mahalanobis distance

hat

hat values

rstand

standardized leverage-corrected residuals

rstud

studentized leverage-corrected residuals

cook

Cook`s distance

Intercept.dfb

DFBetas for the intercept

pred1.dfb

DFBetas for the slope of the predictor pred1

....dfb

DFBetas for the slope of the predictor ...

Arguments

model

a fitted model of class "lm".

check

logical: if TRUE (default), argument specification is checked.

...

further arguments to be passed to or from methods.

Author

Takuya Yanagida takuya.yanagida@univie.ac.at

Details

In regression analysis, an observation can be extreme in three major ways (see Darlington & Hayes, p. 484): (1) An observation has high leverage if it has a atypical pattern of values on the predictors, (2) an observation has high distance if its observed outcome value \(Y_i\) has a large deviation from the predicted value \(\hat{Y}_i\), and (3) an observation has high influence if its inclusion substantially changes the estimates for the intercept and/or slopes.

References

Darlington, R. B., &, Hayes, A. F. (2017). Regression analysis and linear models: Concepts, applications, and implementation. The Guilford Press.

See Also

check.collin, lm

Examples

Run this code
# Example 1: Regression model and measures for leverage, distance, and influence
mod.lm <- lm(mpg ~ cyl + disp + hp, data = mtcars)
check.outlier(mod.lm)

# Merge result table with the data
dat1 <- cbind(mtcars, check.outlier(mod.lm))

Run the code above in your browser using DataLab