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
#>#>#> [1] 1 3 3 6 8 10 10 NAoutliersZ(example, zCutOff = 3.0)#>#>#> [1] 1 3 3 6 8 10 10 1000outliersZ(example, zCutOff = 1.0, replaceOutliersWith = -999)#>#>#> [1] 1 3 3 6 8 10 10 -999outliersZ(example, zCutOff = 1.0, outlierIndices = TRUE)#>#> [1] 8outliersZ(example, zCutOff = 1.0, showZValues = TRUE)#>#>#> [1] -0.39 -0.39 -0.39 -0.38 -0.37 -0.37 -0.37 2.65