outlier_stats: Outlier statistics

View source: R/outlier_stats.R

outlier_statsR Documentation

Outlier statistics

Description

outlier_stats returns the ordered studentized residuals (decreasing based on magnitude) of model to Identify the most unusual observations.

Usage

outlier_stats(model, n = 6L)

Arguments

model

A fitted model object from the lm function.

n

an integer vector of length up to dim(x) (or 1, for non-dimensioned objects). Values specify the indices to be selected in the corresponding dimension (or along the length) of the object. A positive value of n[i] includes the first/last n[i] indices in that dimension, while a negative value excludes the last/first abs(n[i]), including all remaining indices. NA or non-specified values (when length(n) < length(dim(x))) select all indices in that dimension. Must contain at least one non-missing value.

Value

A vector of statistics.

Examples

lmod <- lm(price ~ sqft_living, data = home_sales)
outlier_stats(lmod, n = 3)

api2lm documentation built on July 9, 2023, 5:52 p.m.