Learn R Programming

daltoolbox (version 1.2.747)

outliers_gaussian: Outlier removal by Gaussian 3-sigma rule

Description

Removes outliers from numeric columns using the 3‑sigma rule under a Gaussian assumption: values outside mean ± alpha·sd are flagged as outliers.

Usage

outliers_gaussian(alpha = 3)

Value

returns an outlier object

Arguments

alpha

gaussian threshold (default 3)

References

Pukelsheim, F. (1994). The Three Sigma Rule. The American Statistician 48(2):88–91.

Examples

Run this code
# code for outlier removal
out_obj <- outliers_gaussian() # class for outlier analysis
out_obj <- fit(out_obj, iris) # computing boundaries
iris.clean <- transform(out_obj, iris) # returning cleaned dataset

#inspection of cleaned dataset
nrow(iris.clean)

idx <- attr(iris.clean, "idx")
table(idx)
iris.outliers_gaussian <- iris[idx,]
iris.outliers_gaussian

Run the code above in your browser using DataLab