Box-and-Whisker Plots

AS · S1 · 15 min

A box-and-whisker plot (or box plot) squeezes a whole data set into five numbers drawn against a scale: the smallest value, the lower quartile, the median, the upper quartile and the largest value. It throws away the individual values, but in exchange it makes the centre, the spread and the skew visible at a glance, and two plots drawn on the same scale can be compared instantly. On Paper 5 you draw box plots from raw data, from stem-and-leaf diagrams or from cumulative frequency graphs, and you interpret and compare them.

The five-number summary

Order the data. Then:

Definition
  • The median Q2Q_2 is the middle value; half the data lie below it.
  • The lower quartile Q1Q_1 is the median of the lower half; about a quarter of the data lie below it.
  • The upper quartile Q3Q_3 is the median of the upper half; about three quarters of the data lie below it.
  • The range is the largest value minus the smallest value.
  • The interquartile range (IQR) is Q3−Q1Q_3 - Q_1, the spread of the middle 50%50\% of the data.

For nn raw values, the median is the n+12\tfrac{n+1}{2}th value; each quartile is the median of its half, and when nn is odd the median is excluded from both halves. (See the median note for positions in detail and for grouped data.)

Key result

A box-and-whisker plot shows:

  • a box from Q1Q_1 to Q3Q_3, with a line across it at the median;
  • whiskers from the box out to the smallest and largest values;
  • a labelled scale, so every value can be read off.

Each of the four sections (whisker, half-box, half-box, whisker) holds about a quarter of the data.

Drawing a box plot

Method
  1. Find the five values: minimum, Q1Q_1, median, Q3Q_3, maximum.
  2. Draw a horizontal axis with a uniform, labelled scale that covers the full range. Label it with the variable and units.
  3. Draw the box from Q1Q_1 to Q3Q_3 and a vertical line at the median.
  4. Draw whiskers from the ends of the box to the minimum and maximum, with a short vertical line at each end.
  5. If comparing data sets, draw every plot against the same scale, one above the other, and label each plot.

The box plot below shows two groups of students' marks (the data from the back-to-back example in the stem-and-leaf note). Group A: 24,37,48,58,7824, 37, 48, 58, 78. Group B: 29,40,49,57,7129, 40, 49, 57, 71.

20 30 40 50 60 70 80 90 Mark Group A Group B
Group A: 24, 37, 48, 58, 78. Group B: 29, 40, 49, 57, 71. Same scale, so the plots can be compared directly.

The medians are nearly level, so the groups did about equally well on average. Group A's box and whiskers are both longer, so its marks are more spread out.

Reading skew

The position of the median inside the box tells you about the shape.

Key result
ShapeBox plot featureQuartiles
Symmetricalmedian in the middle of the box, whiskers about equalQ3−Q2≈Q2−Q1Q_3 - Q_2 \approx Q_2 - Q_1
Positive skew (tail to the right)median nearer Q1Q_1; right whisker usually longerQ3−Q2>Q2−Q1Q_3 - Q_2 > Q_2 - Q_1
Negative skew (tail to the left)median nearer Q3Q_3; left whisker usually longerQ3−Q2<Q2−Q1Q_3 - Q_2 < Q_2 - Q_1

Positive skew means most of the values are bunched at the low end with a long tail of larger values, like incomes or waiting times. For positively skewed data the mean is usually larger than the median, because the few large values pull the mean up. For negatively skewed data the mean is usually smaller than the median.

To justify skew in an answer, quote numbers: "Q3−Q2=10Q_3 - Q_2 = 10 and Q2−Q1=4Q_2 - Q_1 = 4, so the data are positively skewed."

Outliers

An outlier is a value that is unusually far from the rest of the data. The Paper 5 syllabus does not define a rule for outliers, so you will only be asked to identify them when the question gives you a rule. The most common rule is:

Tip

A value is often treated as an outlier if it is more than 1.5×IQR1.5 \times \text{IQR} below Q1Q_1 or more than 1.5×IQR1.5 \times \text{IQR} above Q3Q_3. If a question gives this (or another) rule, find the two fences Q1−1.5×IQRQ_1 - 1.5 \times \text{IQR} and Q3+1.5×IQRQ_3 + 1.5 \times \text{IQR}, mark any values outside them with a cross, and draw the whisker only as far as the most extreme value that is not an outlier. Use the question's rule, not this one, if they differ.

Box plots from grouped data

If the data are grouped, the individual values are unknown, so the quartiles and median are estimated from a cumulative frequency graph. The minimum and maximum are not known either; questions then give them, or tell you to use the lowest and highest class boundaries. The box plot is drawn in exactly the same way.

Worked examples

Five-number summary and plot (routine)

The numbers of minutes late for 1111 trains are:

14, 22, 9, 17, 25, 19, 31, 12, 20, 16, 2314,\ 22,\ 9,\ 17,\ 25,\ 19,\ 31,\ 12,\ 20,\ 16,\ 23

(a) Find the median and quartiles. (b) Describe the box-and-whisker plot you would draw.

Solution

(a) Ordered: 9,12,14,16,17,19,20,22,23,25,319, 12, 14, 16, 17, 19, 20, 22, 23, 25, 31. n=11n = 11.

Median == the 66th value =19= 19 minutes.

Lower half: 9,12,14,16,179, 12, 14, 16, 17, so Q1=14Q_1 = 14. Upper half: 20,22,23,25,3120, 22, 23, 25, 31, so Q3=23Q_3 = 23.

(b) On a scale from (say) 55 to 3535 minutes, labelled "Minutes late": a box from 1414 to 2323 with a line at 1919, a left whisker to 99 and a right whisker to 3131.

The right whisker (2323 to 3131) is longer than the left (99 to 1414), and Q3−Q2=4Q_3 - Q_2 = 4 while Q2−Q1=5Q_2 - Q_1 = 5; the box is nearly symmetrical but the long right tail suggests slight positive skew.

Reading proportions from a box plot

A box plot of the masses of 200200 eggs shows: minimum 48 g48\ \text{g}, Q1=55 gQ_1 = 55\ \text{g}, median 59 g59\ \text{g}, Q3=62 gQ_3 = 62\ \text{g}, maximum 66 g66\ \text{g}.

(a) Find the range and interquartile range. (b) Estimate the number of eggs with masses between 55 g55\ \text{g} and 62 g62\ \text{g}, and the number heavier than 59 g59\ \text{g}. (c) Describe the skewness of the distribution, justifying your answer.

Solution

(a) Range =66−48=18 g= 66 - 48 = 18\ \text{g}. IQR =62−55=7 g= 62 - 55 = 7\ \text{g}.

(b) Half of the data lie between the quartiles: about 12×200=100\tfrac{1}{2} \times 200 = 100 eggs. Half lie above the median: about 100100 eggs.

(c) Q3−Q2=62−59=3Q_3 - Q_2 = 62 - 59 = 3 and Q2−Q1=59−55=4Q_2 - Q_1 = 59 - 55 = 4. The median is closer to the upper quartile, and the left whisker (55−48=7 g55 - 48 = 7\ \text{g}) is longer than the right (66−62=4 g66 - 62 = 4\ \text{g}), so the distribution is negatively skewed: the tail is towards the lighter eggs.

Comparing two groups (exam style)

Using the box plots of Group A and Group B in the diagram above, make two comparisons between the marks of the two groups, and say which group's marks have the greater positive skew.

Solution

Average: the medians are 4848 (A) and 4949 (B), so on average Group B scored slightly higher, although the difference is very small.

Spread: the IQRs are 58−37=2158 - 37 = 21 (A) and 57−40=1757 - 40 = 17 (B), and the ranges are 5454 and 4242. Group A's marks are more spread out; Group B's are more consistent.

Skew: for A, Q3−Q2=10Q_3 - Q_2 = 10 and Q2−Q1=11Q_2 - Q_1 = 11; for B, Q3−Q2=8Q_3 - Q_2 = 8 and Q2−Q1=9Q_2 - Q_1 = 9. Both boxes are close to symmetrical, but both have a longer right whisker (A: 2020 against 1313; B: 1414 against 1111), so both show slight positive skew in the tails, more so for Group A.

Applying an outlier rule (exam style)

The times, in seconds, taken by 1212 people to solve a puzzle are:

12, 15, 16, 18, 19, 21, 22, 22, 24, 25, 27, 4412,\ 15,\ 16,\ 18,\ 19,\ 21,\ 22,\ 22,\ 24,\ 25,\ 27,\ 44

An outlier is defined as a value more than 1.5×1.5 \times IQR above the upper quartile or below the lower quartile.

(a) Show that 4444 is an outlier and that there are no other outliers. (b) Describe how the box-and-whisker plot should be drawn.

Solution

(a) n=12n = 12. Median =21+222=21.5= \tfrac{21 + 22}{2} = 21.5. Lower half 12,15,16,18,19,2112, 15, 16, 18, 19, 21: Q1=16+182=17Q_1 = \tfrac{16 + 18}{2} = 17. Upper half 22,22,24,25,27,4422, 22, 24, 25, 27, 44: Q3=24+252=24.5Q_3 = \tfrac{24 + 25}{2} = 24.5.

IQR =24.5−17=7.5= 24.5 - 17 = 7.5, so 1.5×IQR=11.251.5 \times \text{IQR} = 11.25.

Upper fence: 24.5+11.25=35.7524.5 + 11.25 = 35.75. Lower fence: 17−11.25=5.7517 - 11.25 = 5.75.

44>35.7544 > 35.75, so 4444 is an outlier. Every other value lies between 1212 and 2727, inside both fences, so there are no other outliers.

(b) Box from 1717 to 24.524.5 with the median at 21.521.5; left whisker to 1212; right whisker to 2727 (the largest value that is not an outlier); the value 4444 marked separately with a cross.

Reconstructing data from a box plot (exam-hard)

Seven integers have a box-and-whisker plot with minimum 66, lower quartile 99, median 1212, upper quartile 1515 and range 1010. The mean of the seven integers is 1212 and the mode is 1212. Find the seven integers.

Solution

Write them in order as a≤b≤c≤d≤e≤f≤ga \le b \le c \le d \le e \le f \le g. With n=7n = 7, the median is the 44th value, and each half has three values, so Q1Q_1 is the 22nd value and Q3Q_3 the 66th.

So a=6a = 6, b=9b = 9, d=12d = 12, f=15f = 15, and g=6+10=16g = 6 + 10 = 16.

The total is 7×12=847 \times 12 = 84:

6+9+c+12+e+15+16=84⇒c+e=26.6 + 9 + c + 12 + e + 15 + 16 = 84 \quad\Rightarrow\quad c + e = 26.

Order requires 9≤c≤129 \le c \le 12 and 12≤e≤1512 \le e \le 15. The integer pairs with c+e=26c + e = 26 are (c,e)=(11,15)(c, e) = (11, 15) and (12,14)(12, 14).

  • (11,15)(11, 15) gives 6,9,11,12,15,15,166, 9, 11, 12, 15, 15, 16, whose mode is 1515. Rejected.
  • (12,14)(12, 14) gives 6,9,12,12,14,15,166, 9, 12, 12, 14, 15, 16, whose mode is 1212. Accepted.

The integers are 6,9,12,12,14,15,166, 9, 12, 12, 14, 15, 16.

Watch out

No scale, or a non-uniform scale. A box plot without a labelled, evenly spaced axis cannot be read and loses marks. Plot each value accurately; examiners check the median and quartiles to within half a small square.

Watch out

Whiskers through the box. The whiskers stop at the edges of the box. Drawing one line from minimum to maximum through the box makes the median line hard to read and is usually penalised.

Watch out

Calling the IQR "the range of the box plot". The range is maximum minus minimum; the IQR is Q3−Q1Q_3 - Q_1. Name the one you are using.

Exam tip
  • Quartiles from raw data: show the positions you used. For grouped data, write "estimate" and read values from the cumulative frequency graph.
  • "Compare" means at least one statement about average (median) and one about spread (IQR or range), each in context and each with numbers from both plots. "Group A is bigger" is not a comparison.
  • Skew questions want a reason: quote Q3−Q2Q_3 - Q_2 and Q2−Q1Q_2 - Q_1, or describe where the median sits in the box.
  • If you are asked to draw two plots for comparison, use one scale for both. Two plots on different scales cannot be compared and lose the mark.
  • Use a ruler, and draw the plots on the graph paper provided rather than freehand.
Summary
  • Five-number summary: minimum, Q1Q_1, median, Q3Q_3, maximum.
  • Box from Q1Q_1 to Q3Q_3, line at the median, whiskers to the extremes, on a labelled uniform scale.
  • Each of the four sections holds about 25%25\% of the data; the box holds the middle 50%50\%.
  • Median nearer Q1Q_1: positive skew. Median nearer Q3Q_3: negative skew. Justify with Q3−Q2Q_3 - Q_2 and Q2−Q1Q_2 - Q_1.
  • Outliers only by a rule the question gives; whiskers then stop at the most extreme non-outlier.
  • Box plots are ideal for comparing data sets but lose individual values, the mode and the sample size.

Practice questions

Question
  1. The masses, in kg, of 1212 parcels are: 5.2,6.8,4.9,7.3,5.5,6.1,8.4,5.9,6.6,7.0,5.1,6.35.2, 6.8, 4.9, 7.3, 5.5, 6.1, 8.4, 5.9, 6.6, 7.0, 5.1, 6.3. Find the median, quartiles and interquartile range, and describe the box-and-whisker plot.
  2. A box plot of the reaction times of 8080 drivers has minimum 0.320.32, Q1=0.45Q_1 = 0.45, median 0.510.51, Q3=0.68Q_3 = 0.68 and maximum 0.940.94 (seconds). State the range and interquartile range, describe the skewness with a reason, and estimate the number of drivers with a reaction time above 0.680.68 seconds.
  3. For the drivers in question 2, would you expect the mean reaction time to be greater or less than 0.510.51 seconds? Explain your answer.
  4. Two box plots of daily rainfall (mm) in two towns have summaries: Town P: 0,2,5,9,200, 2, 5, 9, 20; Town Q: 1,4,6,7,121, 4, 6, 7, 12. Make two comparisons between the rainfall in the towns.
  5. Using the rule "an outlier is more than 1.5×IQR1.5 \times \text{IQR} from the nearer quartile", determine whether the value 8.48.4 in question 1 is an outlier.
  6. Give one feature of a data set that can be seen in a stem-and-leaf diagram but not in a box-and-whisker plot.
  7. Ten values are 2,4,4,5,7,8,9,11,13,x2, 4, 4, 5, 7, 8, 9, 11, 13, x, where x>13x > 13. Using the rule "an outlier is more than 1.5×IQR1.5 \times \text{IQR} above the upper quartile", find the smallest integer value of xx for which xx is an outlier.
  8. Eight integers in ascending order are 3,5,p,8,q,11,r,153, 5, p, 8, q, 11, r, 15. The median is 8.58.5, the interquartile range is 66 and the mean is 8.8758.875. Find pp, qq and rr.
Answers
  1. Ordered: 4.9,5.1,5.2,5.5,5.9,6.1,6.3,6.6,6.8,7.0,7.3,8.44.9, 5.1, 5.2, 5.5, 5.9, 6.1, 6.3, 6.6, 6.8, 7.0, 7.3, 8.4. n=12n = 12. Median =6.1+6.32=6.2 kg= \tfrac{6.1 + 6.3}{2} = 6.2\ \text{kg}. Q1=5.2+5.52=5.35 kgQ_1 = \tfrac{5.2 + 5.5}{2} = 5.35\ \text{kg}. Q3=6.8+7.02=6.9 kgQ_3 = \tfrac{6.8 + 7.0}{2} = 6.9\ \text{kg}. IQR =1.55 kg= 1.55\ \text{kg}. Box from 5.355.35 to 6.96.9 with median line at 6.26.2; whiskers to 4.94.9 and 8.48.4.

  2. Range =0.94−0.32=0.62 s= 0.94 - 0.32 = 0.62\ \text{s}. IQR =0.68−0.45=0.23 s= 0.68 - 0.45 = 0.23\ \text{s}. Q3−Q2=0.17>Q2−Q1=0.06Q_3 - Q_2 = 0.17 > Q_2 - Q_1 = 0.06 (and the right whisker is longer), so the data are positively skewed. About a quarter of the drivers are above Q3Q_3: 14×80=20\tfrac{1}{4} \times 80 = 20 drivers.

  3. Greater than 0.510.51 seconds. The data are positively skewed, so the relatively few long reaction times in the upper tail pull the mean above the median.

  4. Average: Town Q has the higher median (66 mm against 55 mm), so it typically has more rain on a day. Spread: Town P's rainfall is much more variable (IQR 77 mm against 33 mm; range 2020 mm against 1111 mm).

  5. IQR =1.55= 1.55; 1.5×1.55=2.3251.5 \times 1.55 = 2.325. Upper fence =6.9+2.325=9.225= 6.9 + 2.325 = 9.225. Since 8.4<9.2258.4 < 9.225, 8.48.4 is not an outlier.

  6. Any one of: the individual data values; the number of values; the mode; whether the data have two peaks or gaps.

  7. n=10n = 10. Median =7+82=7.5= \tfrac{7 + 8}{2} = 7.5. Lower half 2,4,4,5,72, 4, 4, 5, 7: Q1=4Q_1 = 4. Upper half 8,9,11,13,x8, 9, 11, 13, x: since x>13x > 13 it is the largest value, so Q3=11Q_3 = 11 whatever xx is. IQR =7= 7, so the upper fence is 11+1.5×7=21.511 + 1.5 \times 7 = 21.5. xx is an outlier when x>21.5x > 21.5, so the smallest integer is x=22x = 22.

  8. n=8n = 8: the median is halfway between the 44th and 55th values, so 8+q2=8.5\tfrac{8 + q}{2} = 8.5, giving q=9q = 9. Lower half 3,5,p,83, 5, p, 8: Q1=5+p2Q_1 = \tfrac{5 + p}{2}. Upper half 9,11,r,159, 11, r, 15: Q3=11+r2Q_3 = \tfrac{11 + r}{2}. IQR: 11+r2−5+p2=6\tfrac{11 + r}{2} - \tfrac{5 + p}{2} = 6, so r−p=6r - p = 6. Mean: the total is 8×8.875=718 \times 8.875 = 71, so 3+5+p+8+9+11+r+15=713 + 5 + p + 8 + 9 + 11 + r + 15 = 71, giving p+r=20p + r = 20. Solving, r=13r = 13 and p=7p = 7. Check the order: 3,5,7,8,9,11,13,153, 5, 7, 8, 9, 11, 13, 15 is ascending. So p=7p = 7, q=9q = 9, r=13r = 13.

How well do you know this?

Builds on

Where this leads

Console

Search notes, courses and tools, or run an action