Skip to contents

Suited to find outliers in asymetric distributions (in contrast to the standard mad() function which works for symmetric distributions only) The function splits the values along the median and returns separate MADs for the left and the right side of the distribution. https://eurekastatistics.com/using-the-median-absolute-deviation-to-find-outliers/

Usage

double_mad(x, zero_mad_action = NULL)

Arguments

x

A vector of numeric values.

zero_mad_action

Determines the action in the event of an MAD of zero. Defaults to NULL. The options are:

  • NULL: process runs with no warning

  • "warn": a warning will be displayed

  • "stop": process is stopped

Value

A numeric vector of length 2.

Examples


x <- c(1, 2, 3, 3, 4, 4, 4, 5, 5.5, 6, 6, 6.5, 7, 7, 7.5, 8, 9, 12, 52, 90)

double_mad(x)
#> [1] 2.0 1.5