| admn | R Documentation |
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.
admn(x, center = c("median", "mean"), na.rm = FALSE)
x |
numeric; A vector of values. |
center |
character; either |
na.rm |
logical; If |
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.
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.
Avraham Adler Avraham.Adler@gmail.com
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 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.
admn(c(1:9))
admn(c(1:9), center = "mean")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.