Written and maintained by CASRAI Editorial Board
Published · Last updated
On this page
The modified z-score is an outlier score that replaces the mean and standard deviation of the ordinary z-score with the median and the median absolute deviation (MAD): Mᵢ = 0.6745 × (xᵢ − x̃) / MAD. Iglewicz and Hoaglin recommend labelling observations with |Mᵢ| greater than 3.5 as potential outliers, and because the median and MAD barely move when an extreme value is present, it still flags outliers that an ordinary z-score hides.
Modified z-score: definition in one paragraph
A modified z-score measures how far an observation lies from the sample median, in units of the sample’s median absolute deviation (scaled by a constant of 0.6745). The NIST/SEMATECH e-Handbook of Statistical Methods lists it as an outlier-labelling technique in its exploratory data analysis chapter. Unlike the ordinary z-score, both its centre (the median) and its spread (the MAD) are resistant measures: a single wild value cannot drag them far, so the score for that value is not shrunk by the very outlier it is trying to detect.
Modified z-score formula (MAD) with every symbol explained
NIST prints the formula as:
Mᵢ = 0.6745 (xᵢ − x̃) / MAD
- Mᵢ: the modified z-score of observation i.
- xᵢ: the i-th observation.
- x̃: the sample median.
- MAD: the median absolute deviation, that is, the median of the values |xᵢ − x̃|. In words: find the median, take each observation’s absolute distance from it, then take the median of those distances.
- 0.6745: a scaling constant. The NIST page does not explain it. SciPy’s documentation for
scipy.stats.median_abs_deviationshows where the same number comes from: withscale='normal'the MAD is divided by the inverse standard normal quantile at 0.75, which is approximately 0.67449. Dividing by 0.67449 is the same as multiplying by about 1.4826 (our own arithmetic, 1 / 0.67449), so the constant puts the MAD on roughly the same footing as a standard deviation for normally distributed data.
Modified z-score vs. standard z-score
The ordinary z-score, z = (x − mean) / SD, uses two statistics that are themselves pulled by outliers. NIST notes that the standard z-score can mislead in small samples: the largest possible z-score in a sample of n values is (n − 1)/√n. For n = 10 that ceiling is 9/√10 ≈ 2.846 (our own arithmetic from NIST’s formula), so a common |z| > 3 rule can never flag anything in a sample of ten. The modified z-score has no such ceiling, because the median and MAD ignore the extreme value’s size. The worked example below shows the difference on real numbers. For the ordinary calculation, see normalizing with z-scores.
Worked example with the arithmetic shown
Take ten measurements, one of which looks suspicious: 12, 13, 13, 14, 15, 15, 16, 17, 18, 41. The data table below lists every observation with its deviation, modified z-score and ordinary z-score.
- Median. The sorted values have a fifth and sixth value of 15 and 15, so x̃ = 15.
- Absolute deviations |xᵢ − 15|, sorted: 0, 0, 1, 1, 2, 2, 2, 3, 3, 26.
- MAD. The median of those ten values is the mean of the fifth and sixth (2 and 2), so MAD = 2.
- Modified z-score for 41. M = 0.6745 × (41 − 15) / 2 = 0.6745 × 13 = 8.77. That is far above 3.5, so 41 is labelled a potential outlier.
- Modified z-score for 12. M = 0.6745 × (12 − 15) / 2 = −1.012, well inside the cut-off. Every other value has |M| of 1.012 or less.
- Ordinary z-score for 41. The mean is 17.4 and the sample standard deviation is 8.501, so z = (41 − 17.4) / 8.501 = 2.776. That is below 3 (and below the 2.846 ceiling for n = 10), so the usual |z| > 3 rule misses the same value that the modified z-score flags decisively.
Interpretation: how to read the result
| |Mᵢ| | Reading | Basis |
|---|---|---|
| 0 | The observation equals the median. | Follows from the formula (xᵢ = x̃). |
| Up to 3.5 | Not labelled as a potential outlier. | Iglewicz and Hoaglin threshold, as quoted by NIST. |
| Greater than 3.5 | Labelled a potential outlier: investigate it. | Iglewicz and Hoaglin threshold, as quoted by NIST. |
NIST describes this as labelling: “potential outliers” are values to inspect, not values to delete. Check for data-entry errors, instrument faults or a genuinely different population before deciding anything. The sign of Mᵢ only tells you the direction (above or below the median). The page on how to find an outlier in statistics compares this with other outlier rules.
Why the median and MAD resist the outlier
Replace 41 in the example with 1000 and nothing changes in the centre or the spread: the sorted values still put 15 and 15 in the middle, the absolute deviations still have a middle pair of 2 and 2, so the median stays 15 and the MAD stays 2. The modified z-score of the extreme value simply grows, to 0.6745 × 985 / 2 = 332.2 (our own arithmetic). The ordinary z-score cannot behave this way, because the mean and standard deviation both absorb the extreme value, and for n = 10 it can never exceed 2.846 whatever the value. This is the practical meaning of a resistant statistic, and it is why NIST lists the modified z-score alongside the ordinary one rather than treating them as interchangeable.
Assumptions and common mistakes
- Approximate normality. NIST states that outlier identification of this kind assumes the data come from an approximately normal distribution. On strongly skewed data a large share of ordinary values can exceed 3.5 and be flagged.
- MAD equal to zero. If more than half the values are identical, the median of the absolute deviations is 0 and the formula divides by zero. This follows directly from the definition; in that situation the modified z-score is undefined and another approach is needed.
- Forgetting the constant. Software often returns the raw MAD by default, or a MAD already multiplied by 1.4826. Mixing these up changes every score. Check which version your function returns before applying 0.6745.
- Automatic deletion. A value above the threshold is a prompt to investigate. Report what you did with it.
- Confusing it with the ordinary z-score. The 3.5 cut-off belongs to the modified score; the 3 used for ordinary z-scores is a different rule.
How to report a modified z-score (APA example)
Name the method, the cut-off and its source, the number flagged and what was done. For example: “Outliers were identified with modified z-scores based on the median and median absolute deviation (Iglewicz & Hoaglin, 1993), using |M| > 3.5 as the cut-off. One observation (41) exceeded the cut-off (M = 8.77) and was retained in a sensitivity analysis.” Add the reference entry in APA 7th edition style: Iglewicz, B., & Hoaglin, D. (1993). How to detect and handle outliers (Vol. 16 of The ASQC Basic References in Quality Control: Statistical Techniques; E. F. Mykytka, Ed.).
How to calculate the modified z-score in Excel, R or Python
Excel
With the data in A2:A11, put the MAD in B1 (entered as an array formula in older Excel versions) and the score beside each value:
B1: =MEDIAN(ABS(A2:A11-MEDIAN(A2:A11)))
B2: =0.6745*(A2-MEDIAN($A$2:$A$11))/$B$1
R
The base mad() function multiplies by 1.4826 unless told otherwise, so request the raw MAD with constant = 1:
x = c(12,13,13,14,15,15,16,17,18,41)
m = 0.6745*(x-median(x))/mad(x, constant=1)
x[abs(m) > 3.5]
Python
import numpy as np
x = np.array([12,13,13,14,15,15,16,17,18,41])
med = np.median(x)
mad = np.median(np.abs(x - med))
m = 0.6745 * (x - med) / mad
print(x[np.abs(m) > 3.5])
All three return 41 for the example above. SciPy’s scipy.stats.median_abs_deviation(x) gives the same raw MAD.
Frequently asked questions
What is a modified z-score?
It is an outlier score built from the median and the median absolute deviation instead of the mean and standard deviation: Mᵢ = 0.6745 (xᵢ − x̃) / MAD.
What is the cut-off for a modified z-score?
Iglewicz and Hoaglin recommend labelling values with an absolute modified z-score greater than 3.5 as potential outliers, as quoted in the NIST/SEMATECH e-Handbook.
Why use the median absolute deviation instead of the standard deviation?
The mean and standard deviation are pulled by the outliers you are looking for. In the example above the ordinary z-score of 41 is only 2.78, while its modified z-score is 8.77.
Does the modified z-score work for small samples?
It avoids the (n − 1)/√n ceiling that limits the ordinary z-score, but it still assumes approximately normal data, and it breaks down when the MAD is 0.
Should I delete values flagged by the modified z-score?
No. They are labelled as potential outliers to investigate; document the decision either way.
Sources
- NIST/SEMATECH e-Handbook of Statistical Methods, section 1.3.5.17, Detection of Outliers: itl.nist.gov/div898/handbook/eda/section3/eda35h.htm (read 2026-11-15).
- NIST/SEMATECH e-Handbook, references (section 1.4.3): Iglewicz, B. and Hoaglin, D. (1993), How to Detect and Handle Outliers, ASQC Basic References in Quality Control, Vol. 16: itl.nist.gov/div898/handbook/eda/section4/eda43.htm (read 2026-11-15).
- SciPy documentation, scipy.stats.median_abs_deviation: docs.scipy.org (read 2026-11-15).
Data: Worked example: modified z-scores and ordinary z-scores for ten observations
Ten observations with their deviation from the median (15), absolute deviation, modified z-score (0.6745 x deviation / MAD, MAD = 2) and ordinary z-score (mean 17.4, sample SD 8.501), computed with the NIST formula.
| Observation | Deviation from median | Absolute deviation | Modified z-score | Ordinary z-score |
|---|---|---|---|---|
| 12 | -3 | 3 | -1.012 | -0.635 |
| 13 | -2 | 2 | -0.674 | -0.518 |
| 13 | -2 | 2 | -0.674 | -0.518 |
| 14 | -1 | 1 | -0.337 | -0.4 |
| 15 | 0 | 0 | 0 | -0.282 |
| 15 | 0 | 0 | 0 | -0.282 |
| 16 | 1 | 1 | 0.337 | -0.165 |
| 17 | 2 | 2 | 0.674 | -0.047 |
| 18 | 3 | 3 | 1.012 | 0.071 |
| 41 | 26 | 26 | 8.768 | 2.776 |
Sources
- NIST/SEMATECH e-Handbook, 1.3.5.17 Detection of Outliers (accessed 2026-11-15)
Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.







