dffits_test {api2lm}R Documentation

Identify influential observations

Description

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).

Usage

dffits_test(model, n = stats::nobs(model))

Arguments

model

A fitted model object from the lm function.

n

The number of outliers to return. The default is all influential observations.

Value

A vector of influential observations.

See Also

dffits

Examples

lmod <- lm(price ~ sqft_living, data = home_sales)
dffits_test(lmod)

[Package api2lm version 0.2 Index]