Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ols_plot_dffits

DFFITS plot


Description

Plot for detecting influential observations using DFFITs.

Usage

ols_plot_dffits(model, print_plot = TRUE)

Arguments

model

An object of class lm.

print_plot

logical; if TRUE, prints the plot else returns a plot object.

Details

DFFIT - difference in fits, is used to identify influential data points. It quantifies the number of standard deviations that the fitted value changes when the ith data point is omitted.

Steps to compute DFFITs:

  • Delete observations one at a time.

  • Refit the regression model on remaining n - 1 observations

  • examine how much all of the fitted values change when the ith observation is deleted.

An observation is deemed influential if the absolute value of its DFFITS value is greater than:

2√(p + 1) / (n - p -1)

where n is the number of observations and p is the number of predictors including intercept.

Value

ols_plot_dffits returns a list containing the following components:

outliers

a data.frame with observation number and DFFITs that exceed threshold

threshold

threshold for classifying an observation as an outlier

Deprecated Function

ols_dffits_plot() has been deprecated. Instead use ols_plot_dffits().

References

Belsley, David A.; Kuh, Edwin; Welsh, Roy E. (1980). Regression Diagnostics: Identifying Influential Data and Sources of Collinearity.

Wiley Series in Probability and Mathematical Statistics. New York: John Wiley & Sons. ISBN 0-471-05856-4.

See Also

[ols_plot_dfbetas()]

Examples

model <- lm(mpg ~ disp + hp + wt + qsec, data = mtcars)
ols_plot_dffits(model)

olsrr

Tools for Building OLS Regression Models

v0.5.3
MIT + file LICENSE
Authors
Aravind Hebbali [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.