outliersZ | R Documentation |
outliersZ is used to identify outliers in vectors using Z-score cut-off
outliersZ(x, zCutOff = 1.96, replaceOutliersWith = NA, outlierIndices = FALSE, showZValues = FALSE, digits = 2)
x |
a vector of numbers |
zCutOff |
value to use as cutoff (1.96 is a common value) |
replaceOutliersWith |
if value is an outlier, what to replace it with? NA by default |
outlierIndices |
return index/position of outlier |
showZValues |
if TRUE, will show z score of each value |
digits |
how many digits/decimals to round output to |
A vector with outliers identified (default converts outliers to NA)
This detection method is not as robust as the median absolute deviation outlier detection method.
Hause Lin
outliers_mad
example <- c(1, 3, 3, 6, 8, 10, 10, 1000) # 1000 is an outlier outliersZ(example) outliersZ(example, zCutOff = 3.0) outliersZ(example, zCutOff = 1.0, replaceOutliersWith = -999) outliersZ(example, zCutOff = 1.0, outlierIndices = TRUE) outliersZ(example, zCutOff = 1.0, showZValues = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.