Skip to contents

This function computes the *median absolute deviation*.

Usage

MAD(x, i = NULL, na.rm = TRUE, ...)

Arguments

x

(named) numerical vector

i

(optional) numerical vector giving the position in x or character vector matching the names in x. If missing or i = NULL, the entire x is considered for the computation of the score

na.rm

logical, whether to remove NA values from x before computation

...

further arguments to mad

Value

A numerical value representing the computed measure. A default NA value is returned if the score can't be computed.

Details

It is a wrapper to mad function.

References

https://en.wikipedia.org/wiki/Median_absolute_deviation

Author

Alessandro Barberis

Examples

x = c(1,1,2,2,4,6,9)
MAD(x)#1.4826
#> [1] 1.4826