grubbs_outliers {Analitica} | R 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 |
vD |
Unquoted name of the numeric variable to be tested for outliers. |
alpha |
Significance level for the test (default is |
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. doi:10.1080/00401706.1969.10490657
Examples
data(d_e, package = "Analitica")
d<-grubbs_outliers(d_e, Sueldo_actual)