π Quartiles and outliers
The rule
- Sort the data first. The median splits it into a lower half and an upper half.
- Q1 is the median of the lower half. About a quarter of the values sit below it.
- Q3 is the median of the upper half. About a quarter of the values sit above it.
- With an odd number of values, leave the median out of both halves.
- The IQR is Q3 β Q1. It is the width of the box: how spread out the middle half is.
- The range uses only the two ends, so one odd value can stretch it. The IQR ignores the ends.
- An outlier is a value far from the rest. The rule: it lies below Q1 β 1.5 Γ IQR or above Q3 + 1.5 Γ IQR.
- An outlier is not always a mistake. Check it before you keep it or drop it.
Examples
Find Q1, Q3 and the IQR of 3, 5, 6, 8, 9, 11, 12. β Q1 = 5, Q3 = 11, IQR = 6
- Seven values. The median is the 4th: 8.
- Lower half: 3, 5, 6, so Q1 = 5.
- Upper half: 9, 11, 12, so Q3 = 11.
- IQR = Q3 β Q1 = 11 β 5 = 6
Leave 8 out of both halves, then take the middle of each.
Find Q1, Q3 and the IQR of 4, 6, 8, 10, 12, 14, 16, 18. β Q1 = 7, Q3 = 15, IQR = 8
- Eight values: two halves of four.
- Lower half: 4, 6, 8, 10. Q1 = (6 + 8) Γ· 2 = 7.
- Upper half: 12, 14, 16, 18. Q3 = (14 + 16) Γ· 2 = 15.
- IQR = 15 β 7 = 8
Eight values split into two halves of four. Each half has two middle values.
In 12, 14, 15, 17, 18, 20, 30, is 30 an outlier? β Yes, 30 is above the upper fence, 29
- The median is 17. Q1 = 14 and Q3 = 20.
- IQR = 20 β 14 = 6.
- 1.5 Γ 6 = 9.
- Fences: 14 β 9 = 5 and 20 + 9 = 29.
- 30 is above 29, so 30 is an outlier.
Work out the fences from Q1, Q3 and the IQR, then check the end values.
Seven houses sold for ($000) 400, 410, 420, 450, 480, 500, 1650. Is the 1650 an outlier? β Yes, it is far above the upper fence, 635
- The median is 450. Q1 = 410 and Q3 = 500.
- IQR = 500 β 410 = 90.
- 1.5 Γ 90 = 135.
- Upper fence: 500 + 135 = 635. Lower fence: 410 β 135 = 275.
- 1650 is above 635, so it is an outlier. The other six are inside the fences.
One very dear house sits well beyond the rest.
Watch out
- βThe IQR is the biggest value minus the smallest.β No: that is the range. The IQR is Q3 β Q1.
- βWith 7 values, the median goes into both halves.β No: leave the middle value out of both halves.
- βAnything above Q3 is an outlier.β No: only values beyond the fence, Q3 + 1.5 Γ IQR.
- βThe fence is Q3 + 1.5.β No: multiply 1.5 by the IQR first, then add it to Q3.