The five-number summary, boxplots and outliers
Summarise a data set in five numbers with boxplots in Year 12 VCE General Mathematics. The delays of V/Line trains or the scores in a footy tipping comp can be reduced to a minimum, two quartiles, a median and a maximum, and a boxplot of them shows the centre, the spread and any unusual values at a glance.
You will find quartiles by splitting the data into halves, work out the interquartile range, and use the fences \(Q_1 - 1.5 \times \text{IQR}\) and \(Q_3 + 1.5 \times \text{IQR}\) to decide which values are outliers. You will draw boxplots with outliers as points and read percentages from them, before meeting the mean and standard deviation.
Theory
A boxplot condenses a whole data set into five numbers. This Year 12 General Mathematics guide for students in Victoria shows how to find the five-number summary and IQR, test for outliers with fences, and draw and read boxplots.
The five-number summary of a data set is the minimum, the first quartile \(Q_1\), the median, the third quartile \(Q_3\) and the maximum. The median splits the ordered data into a lower half and an upper half; \(Q_1\) is the median of the lower half and \(Q_3\) is the median of the upper half. When the number of values is odd, the median itself is left out of both halves.
The interquartile range \(\text{IQR} = Q_3 - Q_1\) is the spread of the middle \(50\%\) of the data. A boxplot draws the five-number summary: a box from \(Q_1\) to \(Q_3\) with a line at the median, and whiskers out to the smallest and largest values. Each of the four sections holds about \(25\%\) of the values.
An outlier is a value below the lower fence \(Q_1 - 1.5 \times \text{IQR}\) or above the upper fence \(Q_3 + 1.5 \times \text{IQR}\). On a boxplot an outlier is drawn as a separate point, and the whisker stops at the most extreme value that is not an outlier.
The fences used to test for outliers:
A value is an outlier if it is less than the lower fence or greater than the upper fence. The median of \(n\) ordered values is at position \(\frac{n + 1}{2}\).
Five-number summary
- Order the data and count the values, \(n\).
- Find the median at position \(\frac{n + 1}{2}\).
- Split into a lower and an upper half (leave the median out if \(n\) is odd).
- \(Q_1\) = median of the lower half, \(Q_3\) = median of the upper half.
- Write min, \(Q_1\), median, \(Q_3\), max.
Outliers and the boxplot
- Find \(\text{IQR} = Q_3 - Q_1\), then \(Q_1 - 1.5 \times \text{IQR}\) and \(Q_3 + 1.5 \times \text{IQR}\).
- Any value beyond a fence is an outlier: plot it as a separate point.
- Draw the box from \(Q_1\) to \(Q_3\) with a line at the median.
- Draw each whisker to the most extreme value that is not an outlier.
With \(n = 11\) the median is the \(6\)th value; leave it out of both halves.
| \(\text{median position}\) | \(=\) | \(\dfrac{11 + 1}{2}\) |
| \(\) | \(=\) | \(6\) |
| \(\text{median}\) | \(=\) | \(10\) |
| \(\text{lower half}\) | \(:\) | \(2,\ 4,\ 5,\ 7,\ 8\) |
| \(Q_1\) | \(=\) | \(5\) |
| \(\text{upper half}\) | \(:\) | \(11,\ 13,\ 15,\ 18,\ 21\) |
| \(Q_3\) | \(=\) | \(15\) |
| \(\text{IQR}\) | \(=\) | \(15 - 5\) |
| \(\) | \(=\) | \(10\) |
The five-number summary is \(2, 5, 10, 15, 21\) minutes, and the IQR is \(10\) minutes.
With \(n = 12\), each half has \(6\) values and every median is a mean of two values.
| \(\text{median}\) | \(=\) | \(\dfrac{33 + 35}{2}\) |
| \(\) | \(=\) | \(34\) |
| \(Q_1\) | \(=\) | \(\dfrac{28 + 30}{2}\) |
| \(\) | \(=\) | \(29\) |
| \(Q_3\) | \(=\) | \(\dfrac{38 + 40}{2}\) |
| \(\) | \(=\) | \(39\) |
| \(\text{IQR}\) | \(=\) | \(39 - 29\) |
| \(\) | \(=\) | \(10\) |
| \(\text{lower fence}\) | \(=\) | \(29 - 1.5 \times 10\) |
| \(\) | \(=\) | \(14\) |
| \(\text{upper fence}\) | \(=\) | \(39 + 1.5 \times 10\) |
| \(\) | \(=\) | \(54\) |
\(62 > 54\), so \(62\) is an outlier. No age is below \(14\). On a boxplot, \(62\) is a separate point and the upper whisker ends at \(41\), the largest age that is not an outlier.
Read the five-number summary from the boxplot. Each section holds about \(25\%\).
| \(\text{median}\) | \(=\) | \(48\) |
| \(\text{IQR}\) | \(=\) | \(55 - 40\) |
| \(\) | \(=\) | \(15\) |
| \(\text{range}\) | \(=\) | \(70 - 30\) |
| \(\) | \(=\) | \(40\) |
| \(\text{below } Q_1\) | \(\approx\) | \(25\% \times 160\) |
| \(\) | \(=\) | \(40\) |
The median is \(48\) g, the IQR is \(15\) g and the range is \(40\) g. \(40\) g is \(Q_1\), so about \(25\%\) of the zucchinis, roughly \(40\) of the \(160\), weigh less than \(40\) g.
Median = \(8\)th value; each half has \(7\) values.
| \(\text{median}\) | \(=\) | \(30\) |
| \(Q_1\) | \(=\) | \(25\ \ (\text{4th of } 3, 21, 24, 25, 27, 28, 29)\) |
| \(Q_3\) | \(=\) | \(35\ \ (\text{4th of } 31, 32, 33, 35, 36, 38, 41)\) |
| \(\text{IQR}\) | \(=\) | \(35 - 25\) |
| \(\) | \(=\) | \(10\) |
| \(\text{lower fence}\) | \(=\) | \(25 - 1.5 \times 10\) |
| \(\) | \(=\) | \(10\) |
| \(\text{upper fence}\) | \(=\) | \(35 + 1.5 \times 10\) |
| \(\) | \(=\) | \(50\) |
The five-number summary is \(3, 25, 30, 35, 41\). \(3 < 10\), so \(3\) is an outlier and is plotted as a separate point; the left whisker ends at \(21\). No score is above the upper fence of \(50\), so the right whisker ends at the maximum, \(41\).
Common pitfalls
Frequently asked questions
What is the five-number summary?
The minimum, the first quartile Q1, the median, the third quartile Q3 and the maximum of a data set. It is exactly what a boxplot draws.
How do you find Q1 and Q3?
Order the data and find the median. Q1 is the median of the lower half and Q3 is the median of the upper half. If the number of values is odd, leave the median out of both halves.
How do you find outliers using the IQR?
Work out IQR = Q3 - Q1. The lower fence is Q1 - 1.5 x IQR and the upper fence is Q3 + 1.5 x IQR. Any value below the lower fence or above the upper fence is an outlier.
Where does the whisker end when there is an outlier?
At the most extreme data value that is not an outlier. The outlier is drawn as a separate point, and the whisker never ends at the fence itself.
What percentage of the data is in each part of a boxplot?
About 25% in each whisker and in each half of the box, so the box holds about the middle 50% of the data.
What does the IQR tell you?
The spread of the middle 50% of the data. Unlike the range, it is not affected by outliers.