Skip to content
Log in

Theory

Outliers and skewed data: how to find them

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.

~11 min read · 11 exercises · 250 points

Before you start

One customer, five times the mean

Another week on CatChow's product team. The growth team is preparing a quarterly review, and one slide shows how much new customers spent in their first 90 days. In the sample, one customer spent almost five times the mean, and someone suggests simply deleting the top values.

Before anyone does, you'll learn why product metrics have long tails, how to spot outliers with a clear rule, and how to decide what each unusual value deserves.

Right skew: a floor at zero, no ceiling

A skewed distribution has a long tail on one side. In right skew (positive skew), most values pile up on the left and a few large ones trail far to the right.

Right skew is the normal state of product and marketing data, because so many metrics have a hard floor at zero and no ceiling:

  • revenue per customer and order value;
  • session length and time to first purchase;
  • number of orders, followers, cost per acquisition.

Most customers spend a little, a few spend a lot, and nobody spends less than zero. If a metric measures "how much" or "how long" and can't go negative, expect a right tail.

90-day spend per new customerA long right tail: most customers spent 20–60 USD, a few spent much more, and one spent 240 USD. The tail pulls the mean (50 USD) to the right of the median (35 USD).

Chart data

Spend in 90 days, USDCustomers
0–193
20–3911
40–595
60–791
80–992
Show 3 more rows
100–1191
120–2390
240–2591

Left skew is rarer. It appears when values are squeezed against a ceiling: app-store ratings where most people give 5 stars, or "percent of lesson completed" when most learners finish.

Not everything is skewed. Factory-controlled values, like the weight of a 2 kg bag, cluster symmetrically around the target. And categories, like the day of the week, have no shape of this kind at all.

  • Do
    “Revenue per customer: expect a long right tail, so check the median before the mean.”

    Anticipates the shape from how the metric works.

  • Don't
    “Our app rating is right-skewed because a few people give 1 star.”

    The tail of 1s points left; the bulk sits at 5.

Three kinds of outliers

An outlier is a value far from the rest of the data. That's a description, not a verdict. Before you act, find out why it's far out. There are three very different reasons.

  1. An error. A developer's test order, a price typed as $2,990 instead of $29.90, a bot that filled a basket. These describe nothing real: fix or remove them, and log what you did.
  2. A genuine extreme. A real customer who loves the product and buys a lot. The value is correct, just rare. Deleting it means pretending your best customers don't exist.
  3. A different population. A customer with 12 orders in 90 days while everyone else has 1–3 is probably a café or a shelter. The data is real, but it answers a different question: analyse it as its own segment.
Three cats stand apart from a crowd: one tangled in a sparking cable, one hugging a huge bag of food, one in an apron beside a row of shelter bowls.
An error, a genuine extreme, or a different kind of customer.

Outliers are information. Sometimes the most important finding in a dataset is the outlier itself: a business segment you didn't know you had, or a tracking bug that has been inflating revenue for a month.

  • Do
    “Removed 3 test orders from the office network (logged); kept 2 big household customers.”

    Errors go, real customers stay, and the change is recorded.

  • Don't
    “Dropped everything above the fence to clean the data.”

    Treats every outlier as an error without looking.

What to do with each kind of outlier

Once you know why a value is unusual, the action usually follows.

  • Errors you can't repair (test orders, duplicates, bot traffic): remove them and log the removal, so that someone rerunning the analysis gets the same numbers.
  • Errors you can repair (a misplaced decimal point, a wrong currency): correct the value. The order was real; only the record was wrong.
  • A different population (a café, a shelter, a reseller): move it to its own segment. Businesses and households behave differently and deserve separate metrics.
  • Genuine extremes (a household that spends three times the median): keep them, especially when the question is about totals. A revenue forecast without your biggest real customers is simply wrong.

If extremes make a summary unstable but aren't the point of the question, use robust tools instead of deleting: the median, the IQR, a trimmed mean, or capping at a high percentile. And when in doubt, report the number both with and without the unusual values.

  • Do
    Treats bag logged at $2,990 → corrected to $29.90.

    The order was real; fix the record, don't drop it.

  • Don't
    Cat café with 12 orders a quarter → deleted as an outlier.

    Real revenue from a real segment disappears.

Tukey's fences: the IQR rule

"Far from the rest" needs a definition, or everyone draws the line where it suits their story. The most common one builds two fences from the quartiles:

  • lower fence = Q1 − 1.5 × IQR
  • upper fence = Q3 + 1.5 × IQR
x∉[ Q1−32 IQR,    Q3+32 IQR ]x \notin \left[\, Q_1 - \tfrac{3}{2}\,\text{IQR},\;\; Q_3 + \tfrac{3}{2}\,\text{IQR} \,\right]
Tukey's rule: a value outside the fences (3/2 = 1.5) is a potential outlier. Values beyond 3 × IQR are sometimes called extreme outliers.

where IQR = Q3 − Q1. Values outside the fences are flagged as potential outliers.

Many cats sit inside a light blue fenced yard; two sit outside the fence, one far away and lit by an orange spotlight.
Outside the fence means take a closer look, not delete.

For campaign clicks with Q1 = 120 and Q3 = 200: IQR = 80, 1.5 × 80 = 120, so the upper fence is 200 + 120 = 320 and the lower fence is 120 − 120 = 0. For CatChow's 90-day spend, Q1 = 24 and Q3 = 56 give an upper fence of $104, which flags two customers.

The rule has one big strength: the fences come from quartiles, so the outliers can't distort them. It has one limit: it only flags values for a closer look. Whether a flagged value is an error, a real extreme or a different population is a question for the raw data, not for the formula.

The same fences decide which points a box plot draws as separate dots.

  • Do
    IQR = 200 − 120 = 80; fence = 200 + 1.5 × 80 = 320

    Start from Q3, add 1.5 IQR.

  • Don't
    Fence = 1.5 × 200 = 300

    Multiplies Q3 instead of adding 1.5 × IQR to it.

How much the tail is worth

Heavy-tailed data has a practical consequence: a small group often brings a large share of the total. Measuring that share is simple.

  1. Add up the whole column: CatChow's 24 new customers spent $1,200 in their first 90 days.
  2. Add up the group you care about: the two customers above the $104 fence spent $240 + $110 = $350.
  3. Divide: 350 / 1,200 ≈ 0.292, or 29.2%.

Dataset · 24 rows

90-day spend of new CatChow customers

A random sample of 24 customers who joined in June: spend and number of orders in their first 90 days. Synthetic data made for this course.

customer_idspend_90dorders_90d
U-5101422
U-5102853
U-5103151
U-5104281
U-5105241

First 5 of 24 rows

Download CSV

So 2 customers out of 24, about 8%, brought almost a third of the money. That is why "just delete the top values" is dangerous. A revenue forecast built without them would be badly wrong, and you'd lose sight of the segment most worth protecting.

The same calculation works for any "top N" question: the share of revenue from the top 10% of customers, the share of traffic from the top 5 pages, the share of support tickets from the top 3 issues. It turns a vague "a few big ones matter" into a number a manager can act on.

  • Do
    (240 + 110) / 1,200 ≈ 29.2%

    Group total over the full total.

  • Don't
    350 / (1,200 − 350) ≈ 41.2%

    Divides by everyone else instead of by the full total.

Reading the shape from mean and median

You can often guess a distribution's shape without seeing it, just by comparing the mean and the median.

  • Mean > median: a few large values pull the mean up. That's right skew, a long tail of big values.
  • Mean ≈ median: roughly symmetric.
  • Mean < median: a few small values drag the mean down. That's left skew.

Time to first purchase with a mean of 19 days and a median of 6 is a clear right tail: half of buyers purchase within 6 days, and a minority who take months pulls the mean to 19.

A quick ratio makes this a habit: divide the mean by the median. Around 1 is balanced; well above 1 (19 / 6 ≈ 3.2, or $50 / $35 ≈ 1.4 for 90-day spend) means a tail worth a look. It takes ten seconds and catches most "the average jumped!" false alarms.

Chart: 90-day spend per new customer · shown above

It's a rule of thumb, not a law: unusual shapes, such as two peaks, can break it. When the decision matters, plot the histogram.

  • Do
    Mean 19 days, median 6: “half of buyers purchase within 6 days; a slow tail pulls the mean up.”

    Reads the gap as a right tail and reports the median.

  • Don't
    “A typical user buys about 19 days after signing up.”

    Half of buyers have already bought by day 6.

Report with and without

When a few values change a summary a lot, the most honest report gives both versions and says what separates them.

"Mean 90-day spend is $50, or $41.74 excluding one likely business customer" does three things at once:

  • it keeps the full number, which is the right one for totals;
  • it shows the version for the population you probably care about, households;
  • it names the exclusion, so anyone can check it and nobody can call it cherry-picking.

Compare "Mean 90-day spend: $41.74 (outliers removed)". The reader doesn't know how many values went, why, or how much they mattered. One of them was a real customer worth $240, and it silently vanished from the story.

The same pattern works for medians, conversion rates and A/B results: "+4% overall, +1% excluding the one bulk buyer". If both versions point the same way, the conclusion is solid. If they disagree, that disagreement is the finding, and the next step is to understand the excluded group.

  • Do
    “Mean $50; $41.74 without U-5120 (12 orders in 90 days, likely a café).”

    Both numbers and the reason for the difference.

  • Don't
    “Mean $41.74 (cleaned data).”

    “Cleaned” hides a real customer and a $8 shift.

Capping: keep the customer, limit the pull

Deleting an extreme value throws away a real customer. Keeping it as is can let one value decide the result. Capping (also called winsorising) is the middle path: replace every value above a chosen limit with the limit itself.

The customer stays in the count and still counts as a big spender, but can't pull the mean further than the cap allows. Common limits are the 99th or 95th percentile, or the upper IQR fence.

With CatChow's 24 customers and a cap at the $104 fence:

  1. Change $110 → $104 and $240 → $104.
  2. New total: 1,200 − 6 − 136 = $1,058.
  3. Divide by all 24 customers: $44.08.

Capping is common in A/B tests on revenue, where a single huge order in one group can otherwise produce a "winner" by itself. Two rules keep it honest: pick the cap before you look at which group benefits, and apply the same cap to every group you compare.

It's still a choice that changes the number, so say in the report that values were capped, and where.

  • Do
    (1,200 − 6 − 136) / 24 = 1,058 / 24 ≈ 44.08

    Everyone stays; only the excess above $104 goes.

  • Don't
    (1,200 − 350) / 22 ≈ 38.64

    That's deleting, not capping: two customers vanish.

Why “3 standard deviations” can fail

A popular rule flags values more than 3 SDs from the mean. On large, bell-shaped data it works reasonably well. On small or skewed data it has a flaw: the outliers inflate the very SD you measure them with.

CatChow's 24 customers have a mean of $50 and an SD of about $47.66. U-5120 at $240 is (240 − 50) / 47.66 ≈ 3.99 SDs out, so it is flagged, but only just. U-5115 at $110 is only 1.26 SDs out and looks ordinary.

Remove U-5120 and recompute: the mean drops to $41.74 and the SD to about $25.74. Now U-5115 is (110 − 41.74) / 25.74 ≈ 2.65 SDs out. One extreme value was hiding another. This is called masking.

A giant orange cat stands in front of a smaller blue cat and hides it from a magnifying glass; only the hidden cat's tail pokes out.
A huge value can hide a smaller one standing behind it.

Tukey's IQR fences don't have this problem, because quartiles barely react to the extremes. That makes them the better default for everyday product data, which is usually small, skewed or both. Two other habits to avoid: flagging a fixed top share every time, and drawing the line by eye.

  • Do
    Q1 = 24, Q3 = 56, fence = 56 + 1.5 × 32 = $104: both $110 and $240 flagged.

    Quartiles aren't pulled by the extremes.

  • Don't
    (110 − 50) / 47.66 ≈ 1.26 SD → “U-5115 is normal.”

    The $240 customer inflated the SD and masked this one.

Ready to practise?

Answer the lesson's exercises and earn 250 points the first time you finish it.

Start the exercises