View source: R/check.outlier.R
check.outlier | R Documentation |
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.
check.outlier(model, check = TRUE, ...)
model |
a fitted model of class |
check |
logical: if |
... |
further arguments to be passed to or from methods. |
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.
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 ... |
Takuya Yanagida takuya.yanagida@univie.ac.at
Darlington, R. B., &, Hayes, A. F. (2017). Regression analysis and linear models: Concepts, applications, and implementation. The Guilford Press.
check.collin
, lm
# 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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.