Lesson 18: Interquartile Range and OutliersSG G3
The range is easily distorted by one extreme value. The interquartile range is not: it measures the spread of the middle half of the data, and it also gives a principled way to decide whether a value is an outlier.
Finding the quartiles
For the nine values 12, 15, 18, 21, 24, 27, 30, 35, 42, the median is the 5th value, 24. The lower quartile is the median of the lower half (12, 15, 18, 21), which is (15 + 18)/2 = 16.5. The upper quartile is the median of the upper half (27, 30, 35, 42), which is (30 + 35)/2 = 32.5. The interquartile range is 32.5 − 16.5 = 16. Quartiles from an even number of values need the same care: for 10, 12, 14, 16, 18, 20, 22, 24, the lower quartile is (12 + 14)/2 = 13 and the upper quartile is (20 + 22)/2 = 21, so the IQR is 8.
Worked example: the 1.5 × IQR rule
A value is an outlier if it lies more than 1.5 × IQR beyond a quartile. For the data above, the upper fence is 32.5 + 1.5 × 16 = 56.5 and the lower fence is 16.5 − 1.5 × 16 = −7.5. The largest value, 42, is below 56.5, so there are no outliers. Contrast the data 3, 5, 6, 7, 8, 9, 40: the quartiles are 5 and 9, the IQR is 4, and the upper fence is 9 + 6 = 15 — so 40 is an outlier. On a box plot, outliers are drawn as separate points beyond the whiskers.
Why the IQR matters
The IQR describes the typical spread while ignoring extremes, which is why it pairs with the median for skewed data. Two classes can have the same range but very different IQRs: one may be tightly clustered with a single wild value, while the other is genuinely spread out. Reporting the IQR alongside the median gives a fairer comparison than the range ever can.
Common mistakes
- Including the median in both halves. For an odd count, the median itself belongs to neither half when finding quartiles.
- Using 1.5 × range instead of 1.5 × IQR. The fences are built from the IQR, not the range.
- Deleting outliers automatically. An outlier is a flag to investigate, not a value to erase without a reason.
Key Terms
- Interquartile range (IQR) — upper quartile minus lower quartile; the spread of the middle half.
- Lower quartile (Q1) — the value one quarter of the way through ordered data.
- Upper quartile (Q3) — the value three quarters of the way through ordered data.
- Outlier — a value lying more than 1.5 × IQR beyond a quartile.
- Fence — a boundary at Q1 − 1.5 × IQR or Q3 + 1.5 × IQR; values beyond it are outliers.
- Box plot — a diagram showing the five-number summary and any outliers.
- Five-number summary — minimum, Q1, median, Q3 and maximum.
Discussion
- Why is the IQR a better measure of spread than the range when data may contain outliers?
- When should an outlier be investigated, and when is it reasonable to leave it in the analysis?
- Why is the median excluded from both halves when finding quartiles for an odd number of values?
Practice
- Find the IQR of 4, 7, 9, 11, 14, 18, 22.
Answer: 11: Q1 = 7, Q3 = 18, and 18 − 7 = 11. - For 3, 5, 6, 7, 8, 9, 40, is 40 an outlier?
Answer: Yes: Q1 = 5, Q3 = 9, IQR = 4, and the upper fence is 9 + 6 = 15. - Find the IQR of 10, 12, 14, 16, 18, 20, 22, 24.
Answer: 8: Q1 = 13, Q3 = 21, and 21 − 13 = 8. - A data set has Q1 = 20 and Q3 = 44. Find the upper fence for outliers.
Answer: 80: IQR = 24, so the fence is 44 + 1.5 × 24 = 80. - Why is the median paired with the IQR rather than with the range?
Answer: Both are unaffected by extreme values, so together they describe typical values and typical spread.
✅ Check your understanding
Quick recall check, generated from this lesson’s key terms. It is practice only and is not graded.