grubbs_outliers: 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)
Value
A data.frame identical to the input, with an added logical column outL
indicating which observations were identified as outliers (TRUE or FALSE).
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.
References
Grubbs, F. E. (1969). "Procedures for Detecting Outlying Observations in Samples."
Technometrics, 11(1), 1–21. tools:::Rd_expr_doi("10.1080/00401706.1969.10490657")