Outlier Test
Run classical outlier tests (Grubbs, Dixon Q, Generalized ESD, Tukey IQR, Hampel, Z-Score) in parallel on a column
Overview
An outlier test checks whether individual observations deviate so far from the rest of the data that they cannot plausibly come from the same distribution — and may instead reflect measurement errors, data entry errors, or a changed process state. The module runs several classical procedures in parallel and compares their verdicts side by side, because no single test is optimal in all situations.
Outlier: A data point that deviates significantly from the rest. Caveat: an outlier is not automatically "wrong" — sometimes it is the most valuable observation in the dataset because it flags an unexpected effect.
Grubbs' Test: Identifies the point most distant from the mean and checks via the t-distribution whether that distance is compatible with normality. Classical single-outlier test, n ≥ 3, requires normality.
Dixon Q Test: Compares the suspected value to its neighbour, scaled by the range. Tabulated for n = 3..30. Very common in analytical chemistry (DIN 53804) for small samples.
Generalized ESD (Rosner 1983): Iterative procedure that identifies up to k outliers simultaneously — avoiding the "masking" effect of single-step tests where one extreme value can hide a second. Recommended when multiple outliers are suspected.
Tukey IQR Rule: Flags points below Q1 − k·IQR or above Q3 + k·IQR (default k = 1.5; "extreme" outliers at k = 3). Distribution-free, robust, and matches the whiskers in a boxplot.
Hampel Identifier: Like the Z-score but using the median and MAD (Median Absolute Deviation) in place of mean and standard deviation. Robust against the bias that real outliers exert on x̄ and s — ideal for "contaminated" data.
Z-score and Modified Z-score: Z = (xᵢ − x̄)/s, typical threshold 3. Beware: mean and standard deviation are themselves distorted by outliers ("masking"). The Modified Z-score (Iglewicz & Hoaglin 1993) uses median and MAD and is more robust — typical threshold 3.5.
Approach
- Look first — a boxplot or individual-value plot immediately shows whether any points look suspect at all.
- Pick a numeric column (at least n ≥ 3; for Generalized ESD prefer n ≥ 15).
- Enable methods that fit the data: small sample → Dixon Q or Grubbs; multiple outliers suspected → Generalized ESD; distribution-free → Tukey IQR or Hampel.
- Set the significance level α (typical 0.05) and the thresholds — Tukey factor 1.5 (potential) or 3 (extreme), Hampel k = 3, Z-score 3, Modified Z 3.5.
- Compare results: when several methods agree the verdict is robust; when they disagree, inspect the distribution.
- Never delete automatically — investigate the root cause of any outlier (measurement error, process disturbance, real new effect) and document what was done.
- If in doubt, run the downstream analysis both with and without the flagged points and evaluate how sensitive the conclusion is.
Pitfalls
Just deleting outliers: An outlier is information, not a data defect. Before removing, check whether there is a physical, measurement, or organisational cause. Otherwise you bias the analysis yourself.
Masking: Two extreme values can hide each other: mean and standard deviation grow with them, and the individual Z-score looks ordinary. Fix: use Generalized ESD or robust methods (Hampel, Modified Z).
Swamping: The opposite: a single extreme point pulls x̄ and s so far that ordinary points are flagged as outliers too. Robust methods help here as well.
Grubbs on non-normal data: On skewed or heavy-tailed distributions Grubbs produces too many false positives. Test for normality first — otherwise switch to Hampel or Tukey IQR.
Dixon outside n = 3..30: Dixon tables are valid for small samples only. For n > 30 use Grubbs (under normality) or Generalized ESD.
Multiple testing without correction: Testing every point in a large sample individually at α = 0.05 will flag 5 % as "outliers" by chance. Generalized ESD corrects step by step — naive single tests do not.
Z-score on small samples: For n < 30 the estimate of s is unstable; a single extreme point distorts the Z-score so strongly that it reports itself as "normal". Modified Z (MAD-based) is more reliable here.
Examples
This module ships with the following example datasets — load any of them in the app with a single click.
Available in the following cycles
- DMAIC: Analyze
- DMADV: Analyze
- 8D: D4 — Root Cause Analysis