Learn R Programming

SciencesPo (version 1.3.9)

outliers: Detect Outliers

Description

Perform an exploaratory test to detect outliers. The quantity for min reveals the minimum deviation from the mean, the integer in closest highlights the position of the element. The quantity for max is the maximum deviation from the mean, and the farthest integer is the position of such higher quantity.

Usage

outliers(x, index = NULL)

Arguments

x
A numeric object
index
A numeric value to be considered in the computations

Value

  • Returns the minimum and maximum values, respectively preceded by their positions in the vector, matrix or data.frame.

encoding

UTF-8

References

Dixon, W.J. (1950) Analysis of extreme values. Ann. Math. Stat. 21(4), 488--506.

See Also

winsorize for diminishing the impact of outliers.

Examples

Run this code
outliers(x <- rnorm(20))

#data frame:
age <- sample(1:100, 1000, rep=TRUE);
outliers(age)

Run the code above in your browser using DataLab