is_outlier: Detect outlier values in a vector using IQR/quantile method

Description Usage Arguments Value Functions

View source: R/outliers.R

Description

Detect outliers in a numeric vector using standard methods.

Certain assessment performance statistics are sensitive to extreme outliers. As such, it is often necessary to remove outliers before performing a sales ratio study.

Standard method is to remove outliers that are 3 * IQR. Warnings are thrown when sample size is extremely small or when the IQR is extremely narrow. See IAAO Standard on Ratio Studies Appendix B. Outlier Trimming Guidelines for more information.

Usage

1
2
3
4
5
is_outlier(x, method = "iqr", na.rm = FALSE, ...)

quantile_outlier(x, probs = c(0.05, 0.95), na.rm = FALSE, ...)

iqr_outlier(x, mult = 3, na.rm = FALSE, ...)

Arguments

x

A numeric vector. Must be longer than 2 and not contain Inf or NaN.

method

Default "iqr". String indicating outlier detection method. Options are iqr or quantile.

na.rm

Default FALSE. A boolean value indicating whether or not to remove NA values. If missing values are present but not removed the function will output NA for those values.

...

Named arguments passed on to methods.

probs

Upper and lower percentiles denoting outlier boundaries.

mult

Multiplier for IQR to determine outlier boundaries.

Value

A logical vector this same length as x indicating whether or not each value of x is an outlier.

Functions


OllieS8/bearing documentation built on Dec. 31, 2020, 3:23 p.m.