View source: R/trans_outliers_gaussian.R
| outliers_gaussian | R Documentation |
Removes outliers from numeric columns using the 3‑sigma rule under a Gaussian assumption: values outside mean ± alpha·sd are flagged as outliers.
outliers_gaussian(alpha = 3)
alpha |
gaussian threshold (default 3) |
returns an outlier object
Pukelsheim, F. (1994). The Three Sigma Rule. The American Statistician 48(2):88–91.
# 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.