From five numbers to a picture
In Topic 1.7 you calculated summary statistics. Now you will draw them. The most common graph of summary statistics is the boxplot (also called a box-and-whisker plot). It is built from five numbers.
The five-number summary of a quantitative data set is:
- the minimum (smallest value),
- the first quartile, Q1,
- the median,
- the third quartile, Q3,
- the maximum (largest value).
These five numbers cut the ordered data into four parts. Each part holds about a quarter (25%) of the values. A boxplot shows those four parts on a number line, so you can see the centre, the spread and the shape at a glance.
The data set used in this guide
A fictional café, the Copper Kettle, recorded how long 15 food deliveries took on one evening. The variable is delivery time, in minutes. Ordered from smallest to largest:
18, 21, 22, 24, 25, 26, 27, 28, 30, 31, 33, 35, 40, 45, 62 (n = 15)
For these data, the mean is x̄ = 467 ÷ 15 ≈ 31.13 minutes.
How to draw a boxplot
- Order the data and find the five-number summary. With n odd, leave the median out of both halves when you find Q1 and Q3.
- Check for outliers with the 1.5 × IQR rule from Topic 1.7. Find IQR = Q3 − Q1, then the fences: Q1 − 1.5 × IQR and Q3 + 1.5 × IQR. Any value beyond a fence is a potential outlier.
- Draw a scale. Use a number line with equal steps that covers every value. Label it with the variable name and the units.
- Draw the box from Q1 to Q3, with a vertical line inside it at the median.
- Draw the whiskers. If there are no outliers, each whisker runs from the box to the minimum or the maximum. If there are outliers, the whisker stops at the most extreme value that is not an outlier.
- Mark each outlier with its own symbol, such as an asterisk (✱) or a dot.
You do not draw the fences. They are only a tool for deciding where the whiskers stop.
Outliers and where the whiskers stop
For the delivery times:
- Median = 8th value = 28 minutes.
- Lower half (first 7 values): 18, 21, 22, 24, 25, 26, 27, so Q1 = 24 minutes.
- Upper half (last 7 values): 30, 31, 33, 35, 40, 45, 62, so Q3 = 35 minutes.
- IQR = 35 − 24 = 11 minutes and 1.5 × IQR = 16.5 minutes.
- Fences: 24 − 16.5 = 7.5 minutes and 35 + 16.5 = 51.5 minutes.
No value is below 7.5. One value, 62 minutes, is above 51.5, so it is a potential outlier. The upper whisker stops at 45 minutes, the largest value that is not an outlier. The lower whisker runs to the minimum, 18 minutes.
Compare the two plots in Figure 1. Apart from Q1, the median and Q3 themselves, each section holds exactly 3 deliveries: 18, 21 and 22 lie below Q1; 25, 26 and 27 lie between Q1 and the median; 30, 31 and 33 lie between the median and Q3; and 40, 45 and 62 lie above Q3. The right section of the plot is long because the large values there are spread out, not because there are more of them.
Reading a boxplot
Each of the four sections of a boxplot holds about 25% of the values:
| Section | From → to | About what share of the data? |
|---|---|---|
| Lower whisker | minimum → Q1 | 25% |
| Left part of the box | Q1 → median | 25% |
| Right part of the box | median → Q3 | 25% |
| Upper whisker (plus any outliers) | Q3 → maximum | 25% |
So the box shows the middle 50% of the data, and its length is the IQR. The whole width of the plot, from minimum to maximum, is the range. When outliers are shown, the upper whisker and the outliers above it together make up the top 25%.
These shares are approximate. With a small n, or with repeated values at a quartile, a section may hold a few more or fewer values than exactly one quarter.
Because each section holds about the same number of values, a longer section means the values in it are more spread out. A shorter section means they are packed more closely.
Shape, the mean and the median
The mean and the median react differently to a long tail. The median depends only on the middle position. The mean uses the size of every value, so a few very large or very small values pull it towards the tail. This gives a useful link:
- Roughly symmetric: the mean and the median are close to each other.
- Skewed right (long tail to the right): the mean is usually greater than the median.
- Skewed left (long tail to the left): the mean is usually less than the median.
On a boxplot, you judge the shape by comparing the two halves. For right skew, the right half (median to Q3, plus the upper whisker) is longer than the left half. For left skew, the left half is longer.
This link is a tendency, not a law. Some unusual distributions break it, especially discrete data with many repeated values. So use words like “usually” or “suggests”, and check a graph when you have one.
The link works in both directions. If a graph shows right skew, you can predict that the mean is larger than the median. If you are told only the mean and the median, a big gap between them suggests skew in the direction of the mean.
What a boxplot cannot show
A boxplot is built from only five numbers, so it hides detail. It does not show:
- the number of values, n (a boxplot of 15 values and one of 15,000 can look the same);
- gaps and clusters inside a section;
- whether the distribution has one peak or two (a bimodal distribution can produce a boxplot that looks symmetric);
- the mean, unless it is added with its own symbol, as in Figures 1 and 2.
If you need to see gaps, clusters or peaks, use a dot plot, stem-and-leaf plot or histogram.
Worked example 1: a boxplot of the delivery times
Question. Using the 15 delivery times, (a) give the five-number summary, (b) decide whether any value is a potential outlier, (c) describe how to draw the boxplot, and (d) describe the shape and say whether the mean or the median is larger.
(a) Ordered data: 18, 21, 22, 24, 25, 26, 27, 28, 30, 31, 33, 35, 40, 45, 62. With n = 15, the median is the 8th value, 28. The lower 7 values give Q1 = 24 (their 4th value). The upper 7 values give Q3 = 35. Five-number summary: 18, 24, 28, 35, 62 minutes.
(b) IQR = 35 − 24 = 11 minutes. 1.5 × 11 = 16.5. Lower fence = 24 − 16.5 = 7.5 minutes. Upper fence = 35 + 16.5 = 51.5 minutes. Since 62 > 51.5, the 62-minute delivery is a potential outlier. No value is below 7.5.
(c) Draw a number line from 10 to 70 minutes in steps of 10, labelled “Delivery time (minutes)”. Draw a box from 24 to 35 with a line at 28. Draw the lower whisker from 24 to 18. Draw the upper whisker from 35 to 45, the largest value that is not an outlier. Mark 62 with an asterisk.
(d) The distribution is skewed right. The median to Q3 distance (7 minutes) is longer than Q1 to the median (4 minutes). The upper whisker (10 minutes) is longer than the lower whisker (6 minutes). There is also a high outlier. So we expect the mean to be greater than the median. Check: x̄ = 467 ÷ 15 ≈ 31.13 minutes, which is greater than the median of 28 minutes.
Interpretation. The middle half of these deliveries took between 24 and 35 minutes. One delivery, at 62 minutes, took unusually long and pulls the mean above the median.
Check. Only 5 of the 15 deliveries took longer than the mean, which fits a mean pulled up by the long right tail.
Worked example 2: reading the shape from a five-number summary
Question. A teacher gave a fictional 50-point quiz to 40 students. The five-number summary of the scores is 16, 31, 38, 42, 47 points, and the mean is about 36.2 points.
(a) Check for outliers. (b) Describe the shape and explain whether the mean fits that shape. (c) About how many students scored 38 or more? (d) A student says, “More students scored between 16 and 31 than between 38 and 42, because that part of the boxplot is much longer.” Is the student right?
(a) IQR = 42 − 31 = 11 points, so 1.5 × IQR = 16.5. Fences: 31 − 16.5 = 14.5 and 42 + 16.5 = 58.5 points. The minimum (16) and maximum (47) lie inside the fences, so there are no outliers. The whiskers run to 16 and 47.
(b) The left half is much longer than the right half. Q1 to the median is 7 points but the median to Q3 is only 4 points. The lower whisker covers 15 points (16 to 31) but the upper whisker covers only 5 (42 to 47). So the distribution is skewed left. We expect the mean to be less than the median, and it is: 36.2 < 38 points.
(c) The median splits the data in half, so about 50% of 40, about 20 students, scored 38 points or more.
(d) No. Each section holds about 25% of the students, so about 10 students are in each section. The section from 16 to 31 is longer because those low scores are more spread out, not because there are more of them.
Check. In the fictional data set behind this summary, exactly 10 students scored from 16 to 30 and exactly 10 scored from 39 to 41, which matches the “about a quarter in each section” idea.
Common misconceptions
- “The whisker always goes to the maximum.” Only when there are no outliers. With outliers, the whisker stops at the most extreme value that is not an outlier.
- “The whisker goes to the fence.” The fence (for example, 51.5 minutes) is not a data value. Whiskers end at actual data values.
- “A longer section contains more data.” Every section holds about 25%. Longer means more spread out.
- “The line in the box is the mean.” It is the median. The mean is not part of a standard boxplot.
- “The mean is always greater than the median in a skewed distribution.” It depends on the direction of the skew, and it is only a tendency.
- “A symmetric boxplot means a bell-shaped, single-peaked distribution.” A boxplot cannot show peaks, gaps or clusters.
- “The box shows the range.” The box shows the IQR, the middle 50%. The range is the whole width of the plot.
- Unlabelled scale. A boxplot needs a number line with the variable name and units.
Where this leads
In Topic 1.9 you will put two or more boxplots side by side on the same scale and compare centre, variability, outliers and skewness. Start with the practice questions, then use the revision notes and the checklist. When you are ready, move on to the Topic 1.9 study guide. To revise quartiles and outlier fences, go back to the Topic 1.7 study guide.
Quick questions
Do I have to show outliers on a boxplot?
If the data have outliers, the usual boxplot in this course marks them with a separate symbol and stops the whisker at the most extreme value that is not an outlier. State which outlier rule you used; the 1.5 × IQR rule is the standard choice for boxplots.
Can I tell the shape of a distribution from its mean and median alone?
Only as a hint. A mean well above the median suggests skew to the right, and a mean well below suggests skew to the left. It is a tendency, not a rule, so check a graph when you have one.