lm_outliers: Returns outlier indices

View source: R/lm_outliers.R

lm_outliersR Documentation

Returns outlier indices

Description

Returns a data.frame with outlier indices for a specific lm model. Indices include studentized residuals, residuals' cook's distance, and residuals' hat values.

Usage

lm_outliers(data, formula, id, verbose = FALSE)

Arguments

data

A data.frame.

formula

A model formula.

id

A column name from data used to identify observations (optional).

verbose

A boolean indicating whether the function should call print on the output. Useful when using lm_outliers with pipes.

Author(s)

Dominique Muller, dominique.muller@univ-grenoble-alpes.fr

Cédric Batailler, cedric.batailler@univ-grenoble-alpes.fr

References

Judd, C. M., McClelland, G. H., & Ryan, C. S. (2009). Data analysis: a model comparison approach (2nd ed). New York ; Hove: Routledge.

Examples

mtcars |>
  lm_outliers(mpg ~ disp) |>
  lm(mpg ~ disp,
     data = _)


cedricbatailler/marguerite documentation built on June 18, 2022, 9:19 a.m.