outlier.remove {OLCPM}R Documentation

remove outliers

Description

This function removes outliers in the data, which are far from the sample median.

Usage

outlier.remove(x, rg = 3)

Arguments

x

a numeric data vector.

rg

a positive number indicating how the outliers are defined; see details.

Details

An outlier is detected if it deviates from the sample median more than rg times interquantile range.

Value

a list containing the following:

x

a new data vector with outliers replaced with NA. The original missing values in the data are preserved.

id

the locations of the outliers in the data vector.

Author(s)

Yong He, Xinbing Kong, Lorenzo Trapani, Long Yu

Examples


a=c(1:5,NA,10000)
outlier.remove(a,3)

[Package OLCPM version 0.1.2 Index]