Section 2.5

Outliers: Detect, Investigate, Decide

An outlier is a value far from the rest. What it is not is automatically a mistake to delete. The single most damaging habit in data analysis is covertly dropping the points that spoil the pattern. The professional move is a three-step loop: detect the extreme value, investigate why it's there, and only then decide, with the reason on record.

Detect: look before you calculate

Your eyes are the best first detector. A histogram, a boxplot, or a scatterplot shows an extreme point instantly, in context. Two rules of thumb then put numbers on it:

  • z-score: how many SDs from the mean. |z| > 3 is a common flag — but the mean and SD are themselves dragged by the outlier, so a lone giant can hide by inflating the SD.
  • 1.5 × IQR: anything below Q1 − 1.5·IQR or above Q3 + 1.5·IQR, the rule that draws a boxplot's whiskers. It uses quartiles, so it resists the very extremes it's hunting.

Both are flags, not verdicts: they nominate points for investigation, they don't sentence them. (Our descriptives calculator reports both automatically for pasted data.)

When the z-score rule cannot see the outlier

That warning about the mean and SD being dragged along deserves a number, because the consequence is worse than it sounds. The mean and SD are computed from the contaminated sample, so a large value pushes the mean toward itself and inflates the SD underneath it — a phenomenon called masking. In the extreme it makes the rule mathematically incapable of firing: in a sample of size n, the largest standardized score any observation can possibly reach is (n − 1)/√n. At n = 10 that ceiling is 2.85, so no value, however absurd, can ever score |z| > 3. The rule you were relying on has no way to say yes.

With more data the ceiling lifts, but a second outlier can pull the SD up far enough to hide the first. Take twenty ages from a class, two of which were typed with a stuck key:

18 19 19 20 20 21 21 22 22 23 23 24 25 26 27 28 31 34 498 511

Mean 71.6, SD 148.12. The z-score of 511 is 2.97 and of 498 is 2.88, so at the conventional |z| > 3 cutoff neither typo is flagged. Each one paid for the other's camouflage.

The repair is to build the detector out of statistics the outlier cannot move. The median doesn't shift, and neither does the median absolute deviation (MAD): take the median, measure how far every point sits from it, and take the median of those distances. Here the median age is 23 and the MAD is 3. Multiplying by 1.4826 rescales it so that on normal data it estimates the same thing the SD does, giving 4.45. A robust z-score then replaces both ingredients:

robust z = (x − median) ÷ (1.4826 × MAD)

On those twenty ages the robust score of 511 is 110 and of 498 is 107, while the oldest genuine student, 34, scores 2.47 and stays comfortably inside. Iglewicz and Hoaglin's usual cutoff is 3.5. The two typos went from invisible to unmissable, and nothing else moved, because the median and the MAD never noticed the typos in the first place. (The 1.5 × IQR fence catches them too, at 37 — quartiles are robust for the same reason.)

Investigate: the three explanations

Every flagged point has one of three stories, and each has its own correct action:

  1. An error. A typo, a unit mix-up, an equipment glitch. If the source is recoverable, correct it (age 511 → 51). If not, mark it missing.
  2. A different population, or an invalid observation. The participant fell asleep, the assay batch failed, the trial doesn't measure what you meant. Exclude and report it, with the pre-decided reason.
  3. A genuine extreme. A real, rare member of a heavy-tailed distribution (a millionaire in an income survey). Keep it, and lean on robust methods (medians, trimmed means, rank tests) so one true point doesn't dominate.

Time to be the methodologist. Here are six flagged cases, each with the context you'd actually have. Pick the action you'd defend, then see the verdict.

🩺 Outlier Triage Clinic

Six real-feeling cases. Read the context — the story matters more than the number — and choose an action. The verdict explains the reasoning and the general rule behind it.

Diagnosed0 / 6
Matched the methodologist0

Decide, and notice the leverage

Why does the decision matter so much? Because a single extreme point can swing a whole result. Below is a real two-group reaction-time study: the treatment truly worked, but one participant's timer kept running after they left the room, logging 24,000 ms. Watch what that one value does to the t-test, and what three defensible responses do to it.

⚖️ One Point, Enormous Leverage

Same study, three handling choices for the 24,000 ms value. Keep it and the real effect vanishes into the noise; deal with it honestly and the effect reappears. Reporting the result both ways is a sensitivity analysis.

Control
Treatment
t-test
Verdict

An outlier is a question, not a verdict. "This point is extreme" is the start of an investigation, never the end. Decide the rule you'll use before you see how it changes your p-value, apply it to every point equally, and report what you did, ideally with and without the point, so the reader can judge for themselves.

Why it matters: silently deleting inconvenient points is how honest researchers drift into p-hacking without noticing: each deletion feels justified, and the false-positive rate climbs. The disciplined alternative is cheap: flag with z or IQR, investigate the cause, act on the cause, and log it. In models, an extreme point can also be a high-leverage case that bends the whole fit (see regression diagnostics). And when a variable is genuinely heavy-tailed, a transformation often tames the extremes without throwing any data away.

Problem 41 of the practice problems includes a cleaning log that kept three ages typed as 999 rather than lose the cases, and asks you to judge that call against the rest of the log.

Common questions

Should I remove outliers before or after checking assumptions?

Neither in isolation — investigate the cause first, because the two questions are entangled. Never delete points simply to make an assumption check pass; that's how honest analysis slides into p-hacking. Often a single fix resolves both at once: a genuine data-entry error corrected removes an assumption violation too, and a log transform can tame a skewed distribution without discarding any data. If an extreme point is real and you're unsure, run the analysis with and without it (a sensitivity analysis) and report both.

Is it ever okay to just delete an outlier?

Only when you can point to a documented reason the observation is invalid (an equipment failure, a participant who didn't follow instructions, an impossible value with no recoverable source) and you report that you removed it and why. What's never acceptable is silently dropping points because they weaken your result. A genuine extreme (a real, rare value from a heavy-tailed distribution) is information, not contamination: keep it and lean on robust methods such as medians, trimmed means, or rank tests so it doesn't dominate.

How many outliers is too many?

Both common rules flag points on perfectly clean data, so a small number of flags means nothing at all. The 1.5 × IQR fences sit at roughly z = ±2.70 on a normal distribution, which catches about 0.7% of it by construction; the |z| > 3 rule catches 0.27%. In simulation, a perfectly normal sample of 200 gets 1.7 IQR flags on average, and 75% of such samples flag at least one point. Two flagged values in 200 people is therefore the expected result, not a finding. Start worrying when the flagged fraction runs several times higher — 7 of 200 is around 3.5%, five times what normal data produces, and that pattern says the variable is heavy-tailed rather than that seven participants misbehaved. The repair for a shape is a transformation or a rank-based test, not seven deletions.