powered by
outlier_test returns the observations identified as an outlier based on the Bonferroni correction for a studentized residuals.
outlier_test
outlier_test(model, n = stats::nobs(model), alpha = 0.05)
A data frame with the outliers.
A fitted model object from the lm function.
lm
The number of outliers to return. The default is all outliers.
The Bonferroni-adjusted threshold at which an outlier is identified. The default is 0.05.
0.05
rstudent, p.adjust
rstudent
p.adjust
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)
Run the code above in your browser using DataLab