Learn R Programming

devianLM (version 1.0.7)

devianLM-package: Detection of Poorly Explained Values in Gaussian Linear Models

Description

The devianLM package provides tools to detect values that are poorly explained by a Gaussian linear model. The method is based on the maximum absolute value of studentized residuals, a statistic that is independent of the model parameters. This approach generalizes several procedures used to detect abnormal values, such as during the longitudinal monitoring of certain biological markers.

Arguments

Author

Guillaume Saulière guillaumesauliere@hotmail.com \ Geoffroy Berthelot geoffroy.berthelot@insep.fr \ Jérôme Dedecker jerome.dedecker@u-paris.fr \

Details

The package offers two main functions:

  • get_devianlm_threshold: Computes the detection threshold via Monte Carlo simulations.

  • devianlm_stats: Fits a Gaussian linear model and flags potential outliers based on the computed threshold.

These methods are particularly useful for regression diagnostics, quality control, and longitudinal monitoring in applied statistics.

Examples

Run this code
set.seed(123)
x <- as.matrix(rnorm(50))
y <- 2 * x + rnorm(50)

# Small n_sims for quick example
result <- devianlm_stats(y, x, n_sims = 100)

Run the code above in your browser using DataLab