3.1 Outliers
A-level Maths Statistics and Mechanics Year 1 (AS) · Edexcel 9MA0 · Chapter 3: Representations of Data
A free A-level Maths Stats and Mechanics Year 1 lesson for Pearson Edexcel A level Mathematics (9MA0) from OBA School: identifying outliers, deciding what to do with them, and cleaning data. Watch the video, read the explanation and worked examples, then try the revision questions. You can work through the full lesson, with more videos, an interactive lesson, a practice quiz and printable worksheets, in our free online course.
What you will learn
- Identify outliers using the rule "more than k × IQR beyond the quartiles"
- Identify outliers using the rule "more than k standard deviations from the mean"
- Decide whether an outlier is an error or a genuine value, and clean a data set
- Work out the effect of removing a value on the mean and standard deviation
Key words
- Outlier: A value that is very different from the rest of the data. A question will tell you which rule to use.
- Anomaly: A value that does not fit the pattern of the data. It may be an error or a genuine but unusual value.
- Fence: A boundary such as Q₃ + 1.5 × IQR. Values beyond a fence are outliers.
- Cleaning data: Finding and dealing with errors, missing values and outliers before analysing the data.
- Missing data: A value that was not recorded, shown in a table as n/a or a blank. It is left out of calculations.
Outliers using the interquartile range
An outlier lies a long way from the main body of the data. A common rule measures this distance in multiples of the IQR, starting from the quartiles (not from the median).
Rule: A value is an outlier if it is greater than Q₃ + k(Q₃ − Q₁) or less than Q₁ − k(Q₃ − Q₁). Usually k = 1.5, but always use the value given in the question.
Worked example: twelve values
Data in order: 3, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 38
12/4 = 3: Q₁ = (15 + 16)/2 = 15.5. 36/4 = 9: Q₃ = (21 + 22)/2 = 21.5. IQR = 6
Lower fence: 15.5 − 1.5 × 6 = 6.5. Upper fence: 21.5 + 1.5 × 6 = 30.5
3 is below 6.5 and 38 is above 30.5.
Answer: the outliers are 3 and 38
Outliers using the standard deviation
When the mean and standard deviation are known, an outlier can be defined as a value more than k standard deviations from the mean. Values of k = 2 or k = 3 are common.
Rule: A value is an outlier if it lies outside the interval x̅ − kσ to x̅ + kσ.
Worked example: mean and standard deviation
The masses of 20 apples have mean 148.2 g and standard deviation 6.1 g. An outlier is more than 2 standard deviations from the mean. Are the masses 133 g and 161 g outliers?
148.2 − 2 × 6.1 = 136.0 and 148.2 + 2 × 6.1 = 160.4
133 is below 136.0; 161 is above 160.4.
Answer: both 133 g and 161 g are outliers
Cleaning data
Real data sets, such as daily weather records, often contain problems. Deal with each one before calculating. An outlier is not automatically wrong: decide whether it is an error or a genuine value, using the context.
- Clear error; Example A daily maximum temperature of 215 °C in a UK May; What to do Remove it (or correct it if the true value is known, e.g. 21.5)
- Missing value; Example n/a in a wind speed column; What to do Leave it out and reduce n by 1
- Trace; Example tr in a rainfall column (less than 0.05 mm); What to do Treat it as 0
- Genuine outlier; Example Very heavy rainfall on one stormy day; What to do Keep it: it is real information
Worked example: cleaning a short record
Daily maximum temperatures (°C): 14.1, 15.8, n/a, 16.2, 215, 13.9, 17.4
215 is impossible for the UK and is removed. n/a is left out.
Mean of the 5 valid values = (14.1 + 15.8 + 16.2 + 13.9 + 17.4)/5 = 77.4/5
Answer: 15.48 °C
Exam tip: When asked whether to remove an outlier, refer to the context: "this value is possible because...", or "this value is impossible because...".
The effect of removing a value
Removing an outlier changes the mean and the standard deviation, often by a lot, while the median and IQR barely move. Use the summary statistics: subtract the value from Σ x, subtract its square from Σ x², and reduce n by 1.
Worked example: removing a recording error
Ten values have Σ x = 250 and Σ x² = 6820. Mean = 25, σ² = 682 − 625 = 57, σ = 7.55
The value 47 is an error and is removed: n = 9, Σ x = 203, Σ x² = 6820 − 47² = 4611
New mean = 203/9 = 22.6; σ² = 4611/9 − (203/9)² = 3.580...
Answer: new mean 22.6, new standard deviation 1.89 (both 3 s.f.)
The standard deviation fell from 7.55 to 1.89: one extreme value was responsible for most of the spread.
Common mistakes
- Measuring from the median instead of the quartiles: the fences are Q₁ − 1.5 × IQR and Q₃ + 1.5 × IQR.
- Using 1.5 when the question gives a different value of k.
- Removing every outlier without thinking: genuine extreme values should be kept.
- Counting n/a as 0 or treating tr as missing. n/a is left out; tr is 0.
- Forgetting to subtract x² from Σ x² (and to reduce n) when removing a value.
Revision questions
Try these, then check your answers below each one.
Question 1. Using the fences from the previous question, which of these values is an outlier? (Choose from: 1; 5; 48; 49.)
Answer: 1
Working: 1 is below the lower fence of 2. The others lie between 2 and 50.
Question 2. A data set has mean 40 and standard deviation 6. An outlier is more than 2 standard deviations from the mean. Find the upper limit above which a value is an outlier.
Answer: 52
Working: 40 + 2 × 6 = 52.
Question 3. Amira says: "An outlier should always be removed from the data before calculating statistics." Is Amira correct?
Answer: No
Working: No. Only outliers that are errors should be removed. A genuine extreme value, such as heavy rain on a stormy day, is real data and should be kept.
Related lessons
- Previous lesson: 2.5 Coding
- Next lesson: 3.2 Box Plots
- In this chapter: 3.3 Cumulative Frequency
- In this chapter: 3.4 Histograms
- In this chapter: 3.5 Comparing Data
Continue in the full course
This lesson is section 3.1 of our free A-level Maths Statistics and Mechanics Year 1 (AS) course. In the full course you get every video for this section, an animated interactive lesson, a self-marking practice quiz, a printable worksheet with a mark scheme, an end-of-chapter test and your progress saved. Go to the full A-level Maths Statistics and Mechanics Year 1 (AS) course.