powered by
dffits_test returns the observations identified as influential based on the absolute value of the DFFITS statistics being larger than a threshold. The threshold used is \(2\sqrt{p/n}\), where \(p = \)length(stats::coef(model)) and \(n = \)stats::nobs(model).
dffits_test
length(stats::coef(model))
stats::nobs(model)
dffits_test(model, n = stats::nobs(model))
A vector of influential observations.
A fitted model object from the lm function.
lm
The number of outliers to return. The default is all influential observations.
dffits
lmod <- lm(price ~ sqft_living, data = home_sales) dffits_test(lmod)
Run the code above in your browser using DataLab