Skip to contents

The median absolute deviation is a measure of statistical dispersion that is more resilient to outliers than the standard deviation. Because the median absolute deviation is more robust to outliers, it may prove useful in distributions with mean or variance.

Usage

geom.mad(x, iters = 100, na.rm = FALSE, ...)

Arguments

x

a numeric vector or matrix containing a set of points in n-dimensions

iters

number of iterations used in Weiszfeld algorithm

na.rm

set to FALSE by default to ignore NA. Set to TRUE to remove NA

...

optional arguments to specify alternative tolerance for convergence current tolerance set to 1e-8.

Value

a numeric vector of length 1L.

Examples

d <- rlnorm(60,1,1.4)
geom.mad(d,iters = 50)
#> [1] 2.961555

x <- matrix(rlnorm(60,1,1.4), ncol = 4)
mapply(geom.mad, as.data.frame(x))
#>        V1        V2        V3        V4 
#> 2.0074695 0.9808406 2.7665753 2.2705555