MerQuR+Statistics Glossary

Statistics Glossary → Median absolute deviation (MAD) and modified z-score

Median absolute deviation (MAD) and modified z-scoreconcept

An outlier-resistant measure of spread equal to the median of the absolute distances of the observations from their median; the modified z-score is the standardized distance computed with it.

MAD is computed as follows: find the median of the data, take each observation's absolute difference from that median, and the median of those differences is the MAD. Because the standard deviation is built on squared deviations from the mean, a single extreme value can inflate it badly, whereas MAD tolerates contamination of up to half the data. For normally distributed data, MAD × 1.4826 is a consistent estimate of the standard deviation, which is why software often reports MAD already scaled by this constant.

The modified z-score is M = 0.6745 · (x - median) / MAD (0.6745 ≈ 1 / 1.4826). Iglewicz and Hoaglin recommend examining observations with |M| > 3.5 as potential outliers. In the ordinary z-score the mean and standard deviation are themselves pulled by the outliers, so extreme values can 'mask' themselves; the modified z-score is much more resistant to this masking. MAD is zero when more than half of the data share the same value, and the modified z-score is then undefined.

An everyday example

Seven homes on a street have monthly electricity bills of 300, 320, 310, 290, 305, 315 and 2000. The median is 310; the distances from it are 10, 10, 0, 20, 5, 5 and 1690, whose median gives MAD = 10. The 2000 bill has a modified z-score of about 0.6745 · 1690 / 10 ≈ 114 and is clearly flagged as an outlier, while the standard deviation is pushed above 600 by that one bill alone.

In MerQur

In Anomaly Detection the 'MAD threshold' parameter sets the cut-off for the modified z-score. In Robust Regression it is one of the 'Scale estimator (MAD, Huber proposal 2)' options, and in Descriptive Statistics the Huber M estimate uses the normalized MAD (1.4826·MAD) as its scale.

Analyses where this concept appears

Descriptive StatisticsRobust Regression (M-estimator)Anomaly Detection

Related concepts

Outlierz-score (standardization)