Lesson 3 of 6 · 18 min

Identifying outliers with the 1.5×IQR1.5 \times \text{IQR} rule

Decide which values are possible outliers using the fences Q1−1.5×IQRQ_1 - 1.5 \times \text{IQR} and Q3+1.5×IQRQ_3 + 1.5 \times \text{IQR}, show them on a box plot, and decide what to do about them.

What you will be able to do

  • Calculate the lower fence Q1−1.5×IQRQ_1 - 1.5 \times \text{IQR} and the upper fence Q3+1.5×IQRQ_3 + 1.5 \times \text{IQR}.
  • Identify the possible outliers in a data set, including the case where a value lies exactly on a fence.
  • Draw a box plot with its whiskers ending at the most extreme values that are not outliers, and the outliers marked separately.
  • Explain what to do with an outlier once you have found it.

These are the ages of everyone at a five-year-old's birthday party in Ipswich:

4, 5, 5, 5, 6, 6, 6, 7, 7, 38

The 38 is obviously different: it's the parent running the party. In Univariate data analysis 1 you called a value like that an outlier by eye. But "obviously different" depends on who is looking. Is 12 an outlier here? Is 9? Statisticians agreed on a rule so that everyone gets the same answer.

Interactive

When does a value become an outlier?

The 38 shows as a separate dot. Drag it down slowly. At what age does it join the whisker? (The answer is worked out below.)

Key idea

The 1.5 × IQR rule

A value xx is not an outlier if

Q1−1.5×IQR≤x≤Q3+1.5×IQRQ_1 - 1.5 \times \text{IQR} \le x \le Q_3 + 1.5 \times \text{IQR}

Any value below the lower fence Q1−1.5×IQRQ_1 - 1.5 \times \text{IQR} or above the upper fence Q3+1.5×IQRQ_3 + 1.5 \times \text{IQR} is a possible outlier. A value exactly on a fence is not an outlier.

Testing for outliers

  1. Find the quartiles

    Order the data and find Q1Q_1 and Q3Q_3 (the medians of the halves).

  2. Find the IQR and 1.5 × IQR

    IQR=Q3−Q1\text{IQR} = Q_3 - Q_1, then multiply by 1.5.

  3. Find the fences

    Lower fence =Q1−1.5×IQR= Q_1 - 1.5 \times \text{IQR}. Upper fence =Q3+1.5×IQR= Q_3 + 1.5 \times \text{IQR}.

  4. Compare

    Any value below the lower fence or above the upper fence is a possible outlier. Usually you only need to check the few smallest and largest values.

For the party, n=10n = 10, so the halves are 4, 5, 5, 5, 6 and 6, 6, 7, 7, 38. That gives Q1=5Q_1 = 5 and Q3=7Q_3 = 7, so IQR=2\text{IQR} = 2 and 1.5×IQR=31.5 \times \text{IQR} = 3.

  • Lower fence: 5−3=25 - 3 = 2
  • Upper fence: 7+3=107 + 3 = 10

The 38 is above 10, so it is a possible outlier. In the widget, the dot joins the whisker when you drag it to 10: a 10-year-old sibling would not be an outlier, but an 11-year-old would.

A data set has Q1=12Q_1 = 12 and Q3=20Q_3 = 20. Calculate the lower and upper fences.

Worked example

Test 3 km run times for outliers

  • Simple familiar

Fourteen Year 11 students ran a 3 km cross-country course. Their times, in minutes, were:

13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 19, 20, 22, 29

Use the 1.5×IQR1.5 \times \text{IQR} rule to determine whether there are any possible outliers.

4 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Find Q1Q_1 and Q3Q_3.

  2. IQR=Q3−Q1\text{IQR} = Q_3 - Q_1; multiply by 1.5.

  3. Fences: Q1−1.5×IQRQ_1 - 1.5 \times \text{IQR} and Q3+1.5×IQRQ_3 + 1.5 \times \text{IQR}.

  4. Check the smallest and largest values against the fences.

Watch out for

  • Using 1.5×1.5 \times the range (24) instead of 1.5×1.5 \times the IQR.

  • Adding 1.5×IQR1.5 \times \text{IQR} to the median instead of to Q3Q_3.

Once you know the outliers, a box plot shows them. The whisker no longer runs to the minimum or maximum: it stops at the most extreme value that is not an outlier, and each outlier gets its own dot (or cross). That way the box plot shows the main body of the data and the unusual values separately.

Worked example

Construct a box plot that shows an outlier

  • Complex familiar

The daily rainfall, in millimetres, on the 13 wet days in one February at Brisbane was:

0.4, 1.2, 2.0, 2.6, 3.8, 5.0, 6.4, 8.2, 9.6, 12.0, 15.4, 22.0, 48.6

Construct a box plot of the data, showing any possible outliers.

The whisker stops at 22.0 mm; the outlier at 48.6 mm is marked with a dot.

6 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Find the five-number summary.

  2. Calculate the fences and identify outliers.

  3. End each whisker at the most extreme value that is not an outlier.

  4. Mark each outlier with a dot.

Watch out for

  • Drawing the upper whisker all the way to 48.6.

  • Treating a negative lower fence as an error. It just means no low outliers are possible.

For a data set, the lower fence is 15 and the upper fence is 63. Which of these values is a possible outlier?

Choose one answer

Common mistake

Outlier traps

  • Using the range or the median. The fences are 1.5×1.5 \times the IQR, measured out from the quartiles.
  • Forgetting the lower fence. Check both ends of the data.
  • Calling a value on the fence an outlier. The rule uses ≤\le, so it isn't.
  • Drawing the whisker to the outlier. Stop the whisker at the most extreme non-outlier and mark the outlier with a dot.
  • Assuming there must be an outlier. Often there are none. A fence can even be negative, below every possible value.

Note

What to do with an outlier

The rule calls these values possible outliers because the rule only flags them. You decide what they mean.

  • Check for an error. A 38-year-old at a five-year-old's party is real; a recorded height of 17.5 m is a typing error for 1.75 m. Correct or remove errors, and say that you did.
  • Keep genuine values. A real extreme value is part of the data. Report it, and explain it in context if you can.
  • Choose resistant statistics. With outliers present, summarise and compare with the median and IQR, which barely move.

Worked example

How old would someone have to be to be an outlier?

  • Complex unfamiliar

The ages, in years, of 11 people in a beginners' surfing class at Noosa are:

16, 18, 19, 21, 22, 24, 25, 27, 29, 31, 34

One more person, older than everyone else, joins the class. Determine the youngest whole-number age this person could be for their age to be a possible outlier.

5 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Place the unknown value in the ordered list.

  2. Find the quartiles (check that they don't depend on the unknown).

  3. Find the relevant fence.

  4. Solve the inequality, remembering that a value on the fence is not an outlier.

Watch out for

  • Using the original 11 values to find the quartiles. The new person changes nn to 12.

  • Answering 45, which is exactly on the fence.

Summary

  • Fences: lower =Q1−1.5×IQR= Q_1 - 1.5 \times \text{IQR}, upper =Q3+1.5×IQR= Q_3 + 1.5 \times \text{IQR}.

  • A value outside Q1−1.5×IQR≤x≤Q3+1.5×IQRQ_1 - 1.5 \times \text{IQR} \le x \le Q_3 + 1.5 \times \text{IQR} is a possible outlier. A value on a fence is not.

  • On a box plot, whiskers end at the most extreme values that are not outliers, and each outlier is marked with a dot.

  • Investigate outliers. Correct errors, keep genuine values, and compare with the median and IQR when outliers are present.

Finished the lesson?

Try the 2 quick checks above and the lesson completes itself, or mark it complete now.

Lesson 3 of 60% read

Save your progress with a free account