Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

outliers

Outliers


Description

Identify outliers using modified Z-score

Usage

outliers(x, s = 1.4826)

Arguments

x

A numeric vector

s

Scaling factor for mad statistic

Value

value for the modified Z-score

Author(s)

Jeffrey S. Evans <jeffrey_evans@tnc.org>

References

Iglewicz, B. & D.C. Hoaglin (1993) How to Detect and Handle Outliers, American Society for Quality Control, Milwaukee, WI.

Examples

# Create data with 3 outliers
    x <- seq(0.1, 5, length=100) 
    x[98:100] <- c(100, 55, 250)
 
 # Calculate Z score
     Z <- outliers(x) 
 
 # Show number of extreme outliers using Z-score
     length(Z[Z > 9.9])
 
 # Remove extreme outliers 
     x <- x[-which(Z > 9.9)]

spatialEco

Spatial Analysis and Modelling Utilities

v1.3-6
GPL-3
Authors
Jeffrey S. Evans [aut, cre], Melanie A. Murphy [ctb], Karthik Ram [ctb]
Initial release
2021-03-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.