outlier_test {api2lm}R Documentation

Identify outliers

Description

outlier_test returns the observations identified as an outlier based on the Bonferroni correction for a studentized residuals.

Usage

outlier_test(model, n = stats::nobs(model), alpha = 0.05)

Arguments

model

A fitted model object from the lm function.

n

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

alpha

The Bonferroni-adjusted threshold at which an outlier is identified. The default is 0.05.

Value

A data frame with the outliers.

See Also

rstudent, p.adjust

Examples

lmod <- lm(price ~ sqft_living, data = home_sales)
outlier_test(lmod)
outlier_test(lmod, alpha = 1, n = 7)
lmod2 <- lm(Petal.Length ~ Sepal.Length + Species, iris)
outlier_test(lmod2)

[Package api2lm version 0.2 Index]