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)

## Arguments

x a vector of numbers value to use as cutoff (1.96 is a common value) if value is an outlier, what to replace it with? NA by default return index/position of outlier if TRUE, will show z score of each value how many digits/decimals to round output to

## Value

A vector with outliers identified (default converts outliers to NA)

## Note

This detection method is not as robust as the median absolute deviation outlier detection method.

## See also

outliersMAD

Hause Lin

## Examples

example <- c(1, 3, 3, 6, 8, 10, 10, 1000) # 1000 is an outlier
outliersZ(example)
#> 1 outliers detected.#> Outliers replaced with NA#> [1]  1  3  3  6  8 10 10 NAoutliersZ(example, zCutOff = 3.0)
#> 0 outliers detected.#> Outliers replaced with NA#> [1]    1    3    3    6    8   10   10 1000outliersZ(example, zCutOff = 1.0, replaceOutliersWith = -999)
#> 1 outliers detected.#> Outliers replaced with -999#> [1]    1    3    3    6    8   10   10 -999outliersZ(example, zCutOff = 1.0, outlierIndices = TRUE)
#> Showing indices of outliers.#> [1] 8outliersZ(example, zCutOff = 1.0, showZValues = TRUE)
#> Showing absolute z-scores for each value.#> 1 outliers detected.#> [1] -0.39 -0.39 -0.39 -0.38 -0.37 -0.37 -0.37  2.65