admn: Mean Absolute Deviation from the Median or Mean for Small...

View source: R/adm.R

admnR Documentation

Mean Absolute Deviation from the Median or Mean for Small Samples

Description

Compute the mean absolute deviation from the median, also known as the average deviation to the median (ADM) and adjust by applying factors calculated specifically for small-sample size to achieve unbiased asymptotic normal consistency.

Usage

admn(x, center = c("median", "mean"), na.rm = FALSE)

Arguments

x

numeric; A vector of values.

center

character; either "median" or "mean" which will be used as the function to calculate the central tendency from which to measure the absolute deviations. Defaults to "median".

na.rm

logical; If TRUE then NA values are stripped from x before computation takes place.

Details

ADM = a_n\sqrt{\frac{\pi}{2}}\frac{1}{n}\sum_{i=1}^n{|x_i - \textrm{center}(x)|}

Similar to Croux & Rousseeuw (1992), a large-scale Monte-Carlo simulation was performed to calculate correction factors to make the standard ADM estimate more unbiased for small samples. It is called \textrm{ADM}_n, to differentiate it from the more standard \textrm{ADM}, given the a_n multiplier is dependent on n—the size of the sample.

This function differs from its larger-scale version, adm, in other ways. First, it only accepts "median" or "mean" as its central tendency, and not a scalar value or any other scalar-valued function, as the factors were only calculated for those two functions. Also, it does not allow passing a user-defined constant, as the intent is to return the unbiased estimate assuming normality.

If na.rm is TRUE then NA values are stripped from x before computation takes place. If this is not done then an NA value in x will cause madn to return NA.

Value

A numeric value representing the average absolute deviation from the requested central tendency adjusted by the asymptotic normality constant and the small-sample bias-reduction constant.

Author(s)

Avraham Adler Avraham.Adler@gmail.com

References

Croux, Christophe and Rousseeuw, Peter J. (1992) "Time-Efficient Algorithms for Two Highly Robust Estimators of Scale", Computational Statistics, Vol. 1, 411–428. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/978-3-662-26811-7_58")}

See Also

See adm for the large-sample version of this function, mad in stats for the median absolute deviation from the median, and madn in this package for the small-sample bias-corrected version of mad.

Examples

admn(c(1:9))
admn(c(1:9), center = "mean")

revss documentation built on March 18, 2026, 9:06 a.m.