Skip to content
CoursesLog in
← Statistics glossary

outlier

An observation far from the rest of the data (a common rule: beyond 1.5 IQR from the quartiles); can distort the mean and SD.

An outlier is an observation that sits far away from the rest of the data. That is a description, not a verdict: the label means "look at me", not "delete me".

How to find them. The everyday default is the interquartile range rule: flag anything below Q1−1.5⋅IQRQ_1 - 1.5 \cdot \text{IQR} or above Q3+1.5⋅IQRQ_3 + 1.5 \cdot \text{IQR}. These are the dots drawn separately on a box plot. Because the fences come from quartiles, the outliers can't distort them. The other popular rule, "more than 3 standard deviations from the mean" (a z-score beyond ±3), works for large, bell-shaped data but fails on small or skewed samples, because the outliers inflate the very SD used to judge them. Whatever rule you use, plot the data too: a histogram or scatter plot reveals odd values that no single cut-off catches.

What to do depends on why the value is so far out:

  1. An error: a test order, a duplicate, a price typed without its decimal point, revenue in the wrong currency. Fix or remove it, and log what you did.
  2. A genuine extreme: a real, very loyal customer. The value is correct, and deleting it means pretending your best customers don't exist.
  3. A different population: a cat café or a reseller mixed in with households. Real data, but it belongs in its own segment.

Outliers matter because the mean, the SD and the variance react strongly to them, while the median and the IQR barely move. Report key metrics with and without the unusual values, use robust summaries when extremes aren't the point, and remember that sometimes the outlier is the finding: a B2B segment you didn't know you had, or a tracking bug.

Example

Ten CatChow orders from one afternoon, sorted: $26, $28, $30, $31, $33, $35, $36, $38, $40, $290.

IQR rule. Lower half 26, 28, 30, 31, 33 gives Q1=30Q_1 = 30; upper half 35, 36, 38, 40, 290 gives Q3=38Q_3 = 38. So IQR=8\text{IQR} = 8, the lower fence is 30−1.5×8=1830 - 1.5 \times 8 = 18 and the upper fence 38+1.5×8=5038 + 1.5 \times 8 = 50. The $290 order is flagged.

3-SD rule. The mean is 587/10=58.70587 / 10 = 58.70 dollars and the sample SD about 81.39, so the $290 order has z=(290−58.7)/81.39≈2.84z = (290 - 58.7) / 81.39 \approx 2.84 and is not flagged. In fact, with n=10n = 10 no value can ever have ∣z∣|z| above (n−1)/n=9/10≈2.85(n - 1)/\sqrt{n} = 9 / \sqrt{10} \approx 2.85, so the 3-SD rule can't flag anything in a sample this small.

Investigate. The order row shows 12 bags of dry food shipped to a cat café: real, but a different kind of customer. Keep it in revenue, and report the typical order separately: "Mean $58.70, or $33.00 without one B2B order (297/9297 / 9); median $34." Had the row turned out to be $29.00 mistyped as $290, you would correct it instead.

Common mistakes

  • Deleting outliers by reflex. "Cleaning" away the biggest customers breaks revenue forecasts: in one CatChow sample the top 2 of 24 new customers brought 29% of 90-day revenue.
  • Relying on the 3-SD rule for small or skewed samples. Outliers inflate the SD and can hide each other (masking), and with 10 values no point can even reach ∣z∣=3|z| = 3. Use the IQR rule as the default.
  • Removing values without a record. If nobody can see what was excluded and why, nobody can reproduce your numbers. Log every removal.
  • Deciding what to drop after seeing A/B test results. Trimming outliers only when it helps the variant is a fast route to false wins. Fix the rule (for example, capping revenue at the 99th percentile) before the test starts.
  • Assuming a flagged value is an error. The rule only says "far from the rest"; check the raw row to tell a bug from a whale or a separate segment.

Learn it in the course

  • Outliers and skewed data · Why product metrics have long tails, how to find outliers with the IQR rule, and what to do with them: fix errors, segment different customers, and never delete whales without thinking.
  • Mann–Whitney: when data isn't normal · A rank-based test for skewed metrics like revenue and session length.
  • The t-test · Comparing the means of two groups and deciding whether the gap is bigger than chance.
  • Clustering for user segmentation · Letting the data suggest user segments instead of guessing them.