Lesson 3 of 6 · 18 min
Identifying outliers with the rule
Decide which values are possible outliers using the fences and , show them on a box plot, and decide what to do about them.
What you will be able to do
- Calculate the lower fence and the upper fence .
- 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.
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 is not an outlier if
Any value below the lower fence or above the upper fence is a possible outlier. A value exactly on a fence is not an outlier.
Testing for outliers
Find the quartiles
Order the data and find and (the medians of the halves).
Find the IQR and 1.5 × IQR
, then multiply by 1.5.
Find the fences
Lower fence . Upper fence .
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, , so the halves are 4, 5, 5, 5, 6 and 6, 6, 7, 7, 38. That gives and , so and .
- Lower fence:
- Upper fence:
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 and . Calculate the lower and upper fences.
Worked example
Test 3 km run times for outliers
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 rule to determine whether there are any possible outliers.
Step 1: Find the quartiles
The data are ordered and , so each half has 7 values. Lower half 13, 14, 14, 15, 15, 16, 16, so . Upper half 17, 17, 18, 19, 20, 22, 29, so .
Step 2: Find the IQR and 1.5 × IQR
, so .
Step 3: Find the fences
Lower fence: . Upper fence: .
Values inside this interval are not outliers. Anything outside it is a possible outlier.
Step 4: Compare the extreme values
The smallest value, 13, is above 9, so there are no low outliers. The largest value, 29, is above 25, so it is a possible outlier. The next largest, 22, is inside the fences.
Try it yourself first, then check the working one step at a time.
Answer
The fences are 9 and 25 minutes. The time of 29 minutes is a possible outlier; there are no others.
Method
Find and .
; multiply by 1.5.
Fences: and .
Check the smallest and largest values against the fences.
Watch out for
Using the range (24) instead of the IQR.
Adding to the median instead of to .
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
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.
Step 1: Find the median
, so the median is the 7th value, 6.4 mm.
Step 2: Find the quartiles
Leave out the median. Lower half 0.4, 1.2, 2.0, 2.6, 3.8, 5.0, so . Upper half 8.2, 9.6, 12.0, 15.4, 22.0, 48.6, so .
Step 3: Find the fences
, and . Lower fence ; upper fence .
Step 4: Identify outliers
No rainfall can be below . Only 48.6 is above 30.8, so it is the one possible outlier.
A negative lower fence just means there can't be any low outliers.
Step 5: Find where the whiskers end
The lower whisker runs to the minimum, 0.4. The upper whisker runs to the largest value that is not an outlier, 22.0, not to 48.6.
Step 6: Draw the plot
On a scale from 0 to 50 mm, draw the box from 2.3 to 13.7 with the median at 6.4, whiskers to 0.4 and 22.0, and a dot at 48.6.
Try it yourself first, then check the working one step at a time.
Answer
Box from 2.3 to 13.7 mm with median 6.4 mm, whiskers to 0.4 mm and 22.0 mm, and the possible outlier 48.6 mm marked separately.
Method
Find the five-number summary.
Calculate the fences and identify outliers.
End each whisker at the most extreme value that is not an outlier.
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?
Common mistake
Outlier traps
- Using the range or the median. The fences are 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 , 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?
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.
Step 1: Decide where the new age sits
The new person is older than everyone, so their age is the largest of the 12 values: 16, 18, 19, 21, 22, 24, 25, 27, 29, 31, 34, .
You don't know , but you know its position, and quartiles only depend on positions.
Step 2: Find the quartiles with 12 values
Lower half: 16, 18, 19, 21, 22, 24, so . Upper half: 25, 27, 29, 31, 34, , so . Neither depends on .
Step 3: Find the upper fence
, so the upper fence is .
Step 4: Apply the rule
is a possible outlier only if . An age of exactly 45 is on the fence, so it is not an outlier.
Step 5: Check the answer
With : the quartiles are still 20 and 30, the fence is still 45, and . With the value sits on the fence and is not an outlier.
Try it yourself first, then check the working one step at a time.
Answer
The new person would need to be at least 46 years old.
Method
Place the unknown value in the ordered list.
Find the quartiles (check that they don't depend on the unknown).
Find the relevant fence.
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 to 12.
Answering 45, which is exactly on the fence.
Summary
Fences: lower , upper .
A value outside 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.