Z-Score vs. IQR: Two Ways to Catch Outliers
Outlier detection sounds simple — find the weird number — but the method you choose changes what "weird" means.
Z-score: distance from the mean
The Z-score measures how many standard deviations a value sits from the mean. A Z-score above ~2.5–3 is a classic outlier threshold. It's fast and intuitive, but it has a weakness: the mean and standard deviation are themselves dragged around by extreme values.
IQR: robust to extremes
The interquartile range (IQR) looks at the middle 50% of the data and flags anything beyond 1.5×IQR past the quartiles. Because it's based on rank, not magnitude, a single huge value can't distort it.
Why run both
- Z-score catches subtle deviations in well-behaved, roughly normal data.
- IQR catches outliers even when the distribution is skewed or already contains extremes.
Hidden In Numbers runs both and flags a value if either method trips, then blends the two strengths into a single severity score.
