Learn R Programming

clinpubr (version 1.1.1)

mad_outlier: Mark possible outliers with MAD.

Description

Mark possible outliers using the median absolute deviation (MAD) method.

Usage

mad_outlier(x, constant = 1.4826 * 3)

Value

A logical vector.

Arguments

x

A numeric vector.

constant

The constant multiplier for the MAD. Default is 1.4826 * 3.

Details

The function calculates the median absolute deviation of the input vector and uses it to identify possible outliers. The default constant multiplier is 1.4826 * 3, which gives approximately the \(3\sigma\) of the normal distribution.

See Also

Examples

Run this code
x <- c(1, 2, 3, 4, 5, 100)
mad_outlier(x)

Run the code above in your browser using DataLab