grubbs_outliers: Outlier Detection Using Grubbs' Test (Iterative)

View source: R/grubbs_outliers.R

grubbs_outliersR Documentation

Outlier Detection Using Grubbs' Test (Iterative)

Description

Detects one or more outliers in a numeric variable using the iterative Grubbs' test, which assumes the data follow a normal distribution.

Usage

grubbs_outliers(dataSet, vD, alpha = 0.05)

Arguments

dataSet

A data.frame containing the data.

vD

Unquoted name of the numeric variable to be tested for outliers.

alpha

Significance level for the test (default is 0.05).

Details

The function applies Grubbs' test iteratively, removing the most extreme value and retesting until no further significant outliers are found. The test is valid only under the assumption of normality.

Value

A data.frame identical to the input, with an added logical column outL indicating which observations were identified as outliers (TRUE or FALSE).

References

Grubbs, F. E. (1969). "Procedures for Detecting Outlying Observations in Samples." Technometrics, 11(1), 1–21. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/00401706.1969.10490657")}

Examples

data(d_e, package = "Analitica")
d<-grubbs_outliers(d_e, Sueldo_actual)

Analitica documentation built on June 14, 2025, 9:07 a.m.