Compute the median absolute deviation, i.e., the (lo-/hi-) median of the absolute deviations from the median, and (by default) adjust by a factor for asymptotically normal consistency.
a numeric vector.
Optionally, the centre: defaults to the median.
The actual value calculated is
constant * cMedian(abs(x - center))
with the default value of
cMedian being the usual, the ‘low’ or ‘high’ median, see
the arguments description for
constant = 1.4826 (approximately
1/ Φ^(-1)(3/4) =
ensures consistency, i.e.,
E[mad(X_1,…,X_n)] = σ
for X_i distributed as N(μ, σ^2) and large n.
values are stripped from
x before computation takes place.
If this is not done then an
NA value in
x will cause
mad to return
IQR which is simpler but less robust,
1 2 3 4 5 6 7 8
We want your feedback!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.