Not sure which lesson to do first? Find your level and get a plan →

Statistics · Grade 9-12

Outlier Detection

Outlier detection is the process of identifying data points that are unusually far from the rest of the dataset, using techniques like the IQR rule, z-scores, or visual inspection of box plots and scatter plots.


Quick Answer

Outlier detection is the process of identifying data points that are unusually far from the rest of the dataset, using techniques like the IQR rule, z-scores, or visual inspection of box plots and scatter plots. Run it before you summarize or model a data set, and whenever one value looks suspicious. The IQR rule flags anything below Q1−1.5×IQR or above Q3+1.5×IQR; the z-score rule flags values with ∣z∣>3. A flag is a question, not a verdict: the value may be a typo, a faulty sensor, or a real and important extreme.

Why This Matters

One bad value can wreck a summary. In a class of 30, a height typed as 1650 cm instead of 165 cm raises the mean by about 50 cm and balloons the standard deviation. Flagging outliers catches such errors before they reach a conclusion, and it also points you to the rare real cases, such as a fraudulent card charge or a patient who reacts unusually to a drug, that are often the most important data.

Intuitive Explanation

Here are the minutes nine friends spent on homework last night: 20, 25, 25, 30, 30, 35, 40, 45, 180. Eight values sit within 25 minutes of each other, and then 180 is more than two hours past the next one. On a dot plot your eye spots it at once. Outlier detection turns that impression into a rule, so two people looking at the same data flag the same points.

The IQR rule measures 'far' with the spread of the middle half. Here Q1=25 and Q3=42.5, so IQR=17.5 and 1.5×IQR=26.25. The fences sit at 25−26.25=−1.25 and 42.5+26.25=68.75. Only 180 lies outside. Quartiles ignore the extremes, so a wild value cannot stretch the ruler that judges it. A z-score rule is weaker here: 180 inflates the standard deviation to about 50, so its own z-score is only about 2.6.

The largest value is not automatically an outlier. In this data set 45 is the second largest and sits well inside the fences. In strongly right-skewed data such as incomes, many top values are part of a long, smooth tail, and the shape, not an error, explains them.

A flag starts an investigation. Check the source: a reading of 6 m for a student's height is a typo to fix; a 180-minute homework night may simply be true and worth reporting.

Think of it like this. An outlier rule is a smoke alarm for data. It beeps when a value is far from the rest, and then you go and look: usually burnt toast (a typo or glitch), occasionally a real fire (a genuine extreme). You never tear out the kitchen because it beeped. Unlike an alarm, you choose the sensitivity: 1.5 IQR or 3 standard deviations.

Core idea. A value counts as an outlier only relative to the spread of the rest of the data; a rule turns 'far away' into a fence, and a flag means investigate, not delete.


When to Use

Check for outliers when one value sits far from the rest on a dot plot or box plot, before you report a mean or standard deviation, and whenever data were typed or recorded by hand. Words such as unusual, suspicious reading or fences point here. If you only need a typical value, the median already resists outliers; if you need a value's rank, use percentiles; for a large, roughly normal data set, a z-score cut-off is the natural rule.

Tip. Ask: Must you decide whether particular values lie far enough from the rest to be flagged, by a fence or z-score cutoff?

How to Recognize It

Before applying a rule, decide whether the task is to judge individual values as unusual, and which summary of the data the rule should be built on.

  1. Is the result a verdict on particular values, flagged or not flagged?

    Yes is outlier detection. If the result is a single spread number for the whole set, compute the Interquartile Range (IQR) and stop there.

  2. Are you given, or can you find, the quartiles, or the mean and standard deviation?

    Quartiles lead to the 1.5×IQR fences; a mean and standard deviation lead to a cutoff such as ∣z∣>3. Finding the z of one value with no cutoff is just a Z-Score (Standard Score).

  3. Is the data set small or lopsided, so the suspect value itself could pull the mean and standard deviation?

    Yes favours the IQR fences, which the suspect value barely moves. A z-score cutoff suits large, roughly bell-shaped data, and checking that outline is part of Distribution Shape.

  4. After flagging, must you also decide how a genuine extreme affects a summary such as the mean?

    That second step is Mean vs Median: report the resistant median, or both centers, when a real extreme stays in the data.

Outlier Detection vs Interquartile Range (IQR) vs Z-Score (Standard Score) vs Skewness

Each of these reacts to values far from the bulk of the data, so far-off points can send you to any of them. Ask whether you are judging single values, measuring a spread, locating one value, or describing a whole tail.

Outlier Detection

Meaning
Outlier detection applies a stated rule to decide which individual values are unusually far from the rest.
Key test
The result is a yes or no for particular values.
Formula
x<Q1−1.5 IQR or x>Q3+1.5 IQR
Example
Snack prices of $3, $4, $4, $5, $5, $6 and $40 have an upper fence of $9, so $40 is flagged.

Interquartile Range (IQR)

Meaning
The IQR is the width of the middle half of the data, the yardstick that the fence rule is built on.
Key test
One spread number for the whole set; nothing is flagged yet.
Formula
IQR=Q3−Q1
Example
For those snack prices the IQR is $2, from Q1 at $4 to Q3 at $6.

Z-Score (Standard Score)

Meaning
A z-score measures how many standard deviations a single value sits from the mean.
Key test
Locates one value; it flags nothing until you add a cutoff such as ∣z∣>3.
Formula
z=x−μσ
Example
A 2.1 m jump in a group with mean 1.5 m and SD 0.2 m has z=3.

Skewness

Meaning
Skewness describes a whole tail of values stretching out to one side, not single stray points.
Key test
Many values thin out gradually; outliers stand apart, often after a gap.
Example
Household incomes thin out gradually toward high values, a right skew rather than a few outliers.

Formula & Notation

Worked Examples

Example 1 — Apply the 1.5 × IQR rule

Easy

Daily screen time (hours) for 11 students: 1.5, 2, 2, 2.5, 3, 3, 3.5, 4, 4, 4.5, 11. Use the 1.5×IQR rule to find any outliers.
Show the steps and the answer
  1. Find the median: with 11 sorted values it is the 6th, which is 3.

    The median splits the data into a lower half and an upper half, and the quartiles come from those halves.

  2. Find the quartiles: lower half 1.5, 2, 2, 2.5, 3 gives Q1=2; upper half 3.5, 4, 4, 4.5, 11 gives Q3=4.

    Each quartile is the median of its half (the median itself is left out because n is odd).

  3. Compute IQR=4−2=2 and 1.5×IQR=3.

    The fences sit 1.5 IQRs beyond the quartiles, so 3 hours is the allowed reach here.

  4. Build the fences: lower 2−3=−1, upper 4+3=7. Compare: 11 > 7, and nothing is below −1.

    Only values outside the fences are flagged; 4.5 is the next largest and is well inside.

Answer: 11 hours is the only outlier; the fences are −1 and 7 hours.

Takeaway: Build the fences from the quartiles, then compare every value to them; being the largest is not enough, being past the fence is.

Example 2 — When the z-score rule misses

Standard

A lab group times a ball rolling down a ramp in 8 trials (seconds): 2.1, 2.2, 2.2, 2.3, 2.3, 2.4, 2.4, 9.8. Which values does the rule '∣z∣>3' flag? Which does the 1.5×IQR rule flag? Explain the difference.
Show the steps and the answer
  1. Compute the mean and sample standard deviation: xˉ≈3.21 s, s≈2.66 s.

    The z-score rule judges distance with these two numbers, and 9.8 is included in both.

  2. Find the z-score of 9.8: z=9.8−3.212.66≈2.47, which is less than 3.

    The single slow trial has pulled the mean up and stretched s, so it hides itself. With only 8 values, no point can reach ∣z∣>3 at all.

  3. Apply the IQR rule: Q1=2.2, Q3=2.4, IQR=0.2, upper fence 2.4+0.3=2.7.

    Quartiles come from the middle of the data, so 9.8 cannot stretch them.

  4. Compare: 9.8 > 2.7, so the IQR rule flags it.

    The other seven trials agree to within 0.3 s, so a 9.8 s trial almost certainly had a problem, such as a late stop on the timer.

Answer: The |z| > 3 rule flags nothing (z ≈ 2.47); the 1.5 × IQR rule flags 9.8 s.

Takeaway: In small data sets an outlier inflates the standard deviation that judges it; use the IQR rule or a plot, and save ∣z∣>3 for large data sets.

Example 3 — Find the mistake: deleting a real extreme

Application

Daily rainfall (mm) in a town over 10 days: 0, 0, 1, 2, 2, 3, 4, 5, 6, 85. The 85 mm day was a storm that flooded two streets. Priya writes: 'By the 1.5×IQR rule, 85 is an outlier, so I removed it. Total rainfall: 23 mm. Mean: 2.6 mm per day.' Find the mistake and correct it.
Show the steps and the answer
  1. Check the flag: Q1=1, Q3=5, IQR=4, upper fence 5+6=11; 85 > 11.

    Priya's detection is right; the error is what she did next.

  2. Ask where the value came from: a storm that flooded streets is a real, recorded event.

    Only confirmed errors (typos, broken gauges) should be removed. A genuine extreme is data.

  3. Recompute with the storm kept: total =108 mm, mean =10.8 mm, median =2+32=2.5 mm.

    Deleting 85 hid 85/108≈79% of the rain that fell, the very event a flood planner needs.

  4. Choose the summary: report the median 2.5 mm as a typical day and name the 85 mm storm separately.

    The median describes ordinary days without being dragged by the storm, and nothing is thrown away.

Answer: Keep the 85 mm day: total rainfall 108 mm, median 2.5 mm per day, with one 85 mm storm reported separately.

Takeaway: An outlier rule tells you where to look; remove a value only when you can show it is an error.

Where You'll See It

  • A typo in a data entry

    If a student's height is logged as 6500 cm instead of 165 cm, outlier detection flags it as impossibly far from the rest, signaling a data-entry error to fix.

  • The one mansion in a neighborhood of starter homes

    A $10 million house among $300k homes shows up as an outlier in the price data; it's real, but it distorts the mean and should be noted, not silently averaged in.

  • A fitness tracker's impossible heart rate spike

    A reading of 250 bpm during a calm walk is an outlier that probably came from a sensor glitch, caught by comparing it to your usual range.

Common Mistakes

  1. The slip: Any value flagged as an outlier should be deleted.

    Why it's tempting: Outliers mess up averages, so removing them seems like cleanup, but a genuine extreme value may be the most important data point.

    Instead: Investigate each outlier first: remove only confirmed errors; keep genuine extreme observations and report their effect.

  2. The slip: An outlier is simply the biggest or smallest number in the set.

    Why it's tempting: Extremes are the obvious suspects, so 'max and min' get labeled outliers automatically, but being largest doesn't make a value unusually far from the rest.

    Instead: An outlier is a value unusually far from the bulk of the data, judged by a rule like the 1.5×IQR rule or a z-score, not just by being the extreme.

  3. The slip: One detection method is enough to declare a point an outlier.

    Why it's tempting: A single rule gives a clean yes/no, which feels decisive, but different methods (IQR, z-score, visual) can disagree.

    Instead: Use more than one method and the data's context before deciding a point is a genuine outlier.


Mini Practice

Try these on your own. Tap Reveal when you want to check.

  1. Use the 1.5 × IQR rule to decide whether 45 is an outlier in 12, 14, 15, 15, 16, 18, 19, 21, 45.

    Hint: Find Q1 and Q3 with the median 16 left out, then build the fences.

  2. Test scores have mean 70 and standard deviation 5. Using the rule ∣z∣>3, is a score of 86 an outlier? Is a score of 58?

    Hint: Compute z=x−μσ for each score.

  3. A box plot has Q1=40 and Q3=60. Using the 1.5 × IQR rule, which of the values 5, 15, 92 and 95 are outliers?

    Hint: Build the lower and upper fences first.

  4. For the data 20, 22, 23, 25, 90, find the mean and median with and without the 90.

    Hint: Recompute both measures after removing the value.

  5. Incomes in a region are strongly right-skewed. To flag unusual incomes, should you use the ∣z∣>3 rule or the 1.5 × IQR rule?

    Hint: Which rule depends on the mean and standard deviation?

  6. Daily rainfall in one week was 0, 2, 1, 3, 0, 85 and 2 mm. A student deletes the 85 "because it is an outlier". What should the student do instead?

    Hint: Could 85 mm be a real reading?

Want the full set?

50 practice questions for this concept — free to try, every one with a complete worked solution showing the why, not just the answer.

Frequently Asked Questions

Why can the z-score rule miss an outlier that the IQR rule catches?

Because the suspect value inflates the very mean and standard deviation used to judge it, which shrinks its own z-score. In small data sets the effect is severe: with only 10 values, no value can ever reach ∣z∣>3|z| > 3, however wild it is. The quartiles hardly move when one value goes extreme, so the IQR fences still catch it. That is why the z-score rule is kept for large, roughly bell-shaped data.

Can a point be an outlier in a scatter plot even if neither of its numbers is unusual?

Yes. A height of 180 cm is ordinary and a mass of 50 kg is ordinary, but a person with both sits far below the trend of height against mass. Checking each variable on its own, with fences or z-scores, would miss this point. In two-variable data you look for points far from the fitted line, using their residuals, which is a different test from the one-variable rules in this lesson.

Why does the IQR rule flag so many values in income data?

The 1.5 IQR rule quietly assumes a roughly symmetric shape. Incomes are strongly right-skewed, so a long tail of genuine high earners sits beyond the upper fence, and the rule can flag several percent of perfectly real households. Those flags are not errors to delete. For skewed data, describe the tail with the median and IQR, analyse the logarithm of the values, or use a rule designed for skewed data.

Learning Path

Outlier Detection

You are here

Next →

Mean vs Median
You need the Interquartile Range (IQR), whose quartiles build the fences, and Z-Scores, which measure distance in standard deviations. Outlier detection adds a rule for when a value is far enough to question, plus the habit of investigating before deleting. Next, Mean vs Median shows why the flag matters: an outlier drags the mean but barely moves the median.

See Also