cleanOutliers {PCRA}R Documentation

Clean Returns Outliers

Description

Outliers are "cleaned" by shrinking or rejecting data whose distance from the median (med) is larger in absolute value than a specified value k multiplied by the median absolute deviation from the median (mad). Outlier shrinkage results in the data value being set equal to the nearest of med-k*mad and med+k*mad. Rejected data is assigned an NA. Shrinkage is the default.

Usage

cleanOutliers(x, k = 3, shrink = TRUE)

Arguments

x

A numeric vector

k

A numeric value, which multiplies the mad. Smaller values of k result in greater fractions of data which is either shrunk of rejected, and larger values of k result in smaller fractions of the data that are shrunk or rejected.

shrink

A logical variable whose default is TRUE.

Value

an outlier cleaned numeric object

Examples

args(cleanOutliers)

[Package PCRA version 1.2 Index]