Learn R Programming

SciencesPo (version 1.02.12)

outliers: Detect Outliers

Description

Perform an exploaratory test to detect outliers. This function returns the minimum and maximum values, respectively preceded by their positions in the vector, matrix or data.frame. The quantity for min reveals the minimum deviation from the mean, the integer in closest highlights the position of the element. In the same vein, 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

  • The returning object will depend on the inputing object, either a vector or a data frame.

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:
data(ssex)
outliers(ssex)

Run the code above in your browser using DataLab