outbox: Detect outlier using Boxplot rule

Description Usage Arguments Details Examples

Description

Detect outlier using Boxplot rule

Usage

1
outbox(x, mbox = FALSE, gval = NA, plotit = TRUE)

Arguments

x

An R object. Currently there are methods for numeric/logical vectors and date, date-time and time interval objects. Complex vectors are allowed for trim = 0, only.

mbox

Logical; Using the modification of the boxplot rule suggested by Carling (2000). Defaults to FALSE.

See https://www.researchgate.net/publication/4894204_Resistant_outlier_rules_and_the_non-Gaussian_case for more details

gval

Length of the whiskers as multiple of IQR. Defaults to 1.5

plotit

Logical; Plot it or not?

Details

It is based on the fundamental strategy of avoiding masking by replacing the mean and standard deviation with measures of location and dispersion that are relatively insensitive to outliers.

In particular, the boxplot rule declares the value X an outlier if

X < ql − 1.5(qu − ql )

or

X > qu − 1.5(qu − ql )

So, the rule is based on the lower and upper quartiles, as well as the interquartile range, which provide resistance to outliers.

The ideal fourths are used to estimate the quartiles.

Examples

1
2
x<- c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 100, 500)
outbox(x)

shizidushu/fsrs documentation built on May 26, 2019, 4:32 a.m.