Grade by Grade
D. Statistical Analysis · Two-Variable Data Analysis and Validity

Comparing Groups: Side-by-Side Box Plots

D2.3 D2.5About 65 minutes
Learning goals
  • I can find the five-number summary and use the 1.5 × IQR rule to identify outliers.
  • I can draw side-by-side box plots on one common scale, by hand and with technology.
  • I can compare groups by centre, spread, shape, overlap and outliers, in context.
  • I can explain what side-by-side box plots hide, such as group sizes and the shape inside each box.

Words to know

five-number summary
Minimum, first quartile (Q1), median, third quartile (Q3) and maximum.
interquartile range (IQR)
Q3 − Q1: the spread of the middle half of the data.
fences
Q1 − 1.5 × IQR and Q3 + 1.5 × IQR. Values beyond the fences are flagged as outliers.
modified box plot
A box plot whose whiskers stop at the most extreme values inside the fences, with outliers drawn as separate points.
side-by-side box plots
Box plots for several groups drawn on one common scale so the groups can be compared.
skewed
Not symmetric. In a right-skewed (positively skewed) distribution, the long tail is toward the larger values.

Who gets to school fastest?

A school council surveyed 33 students about how they get to school (walk, bus or driven) and how long the trip takes. One variable is categorical (travel mode) and one is numerical (minutes). A scatter plot does not work, because the travel mode is not a number. Instead, make one box plot for each group and draw them on the same scale: side-by-side box plots.

Remember: you build five-number summaries, box plots and the outlier rule in the sibling unit One-Variable Data Analysis. Here is a short recap, then the new part: comparing groups.

ModeCommute times (minutes), in order
Walk4, 6, 7, 8, 9, 10, 11, 12, 14, 15, 31
Bus12, 15, 18, 20, 22, 24, 25, 27, 30, 33, 38, 45
Driven5, 7, 8, 9, 10, 11, 12, 13, 15, 18
Commute times for 33 students (made-up data).

Recap: five-number summary and outliers

In this course we find quartiles by splitting the ordered data into a lower half and an upper half. When n is odd, leave the median out of both halves. Q1 is the median of the lower half and Q3 is the median of the upper half. (Calculators and spreadsheets sometimes use slightly different methods, so their quartiles can differ a little.)

A value is an outlier if it is below Q1 − 1.5 × IQR or above Q3 + 1.5 × IQR. In a modified box plot, the whiskers stop at the most extreme values inside these fences, and outliers are drawn as separate dots.

Worked example

Example 1: Five-number summaries

Find the five-number summary and any outliers for each travel mode.

  1. Walk (n = 11): median is the 6th value, 10. Lower half 4, 6, 7, 8, 9: Q1 = 7. Upper half 11, 12, 14, 15, 31: Q3 = 14. IQR = 7. Fences: 7 − 10.5 = −3.5 and 14 + 10.5 = 24.5. So 31 is an outlier; the upper whisker ends at 15.
  2. Bus (n = 12): median = (24 + 25) ÷ 2 = 24.5. Lower half 12, 15, 18, 20, 22, 24: Q1 = (18 + 20) ÷ 2 = 19. Upper half 25, 27, 30, 33, 38, 45: Q3 = (30 + 33) ÷ 2 = 31.5. IQR = 12.5. Fences: 0.25 and 50.25. No outliers.
  3. Driven (n = 10): median = (10 + 11) ÷ 2 = 10.5. Lower half 5, 7, 8, 9, 10: Q1 = 8. Upper half 11, 12, 13, 15, 18: Q3 = 13. IQR = 5. Fences 0.5 and 20.5. No outliers.

Walk: 4, 7, 10, 14, 31 (31 is an outlier). Bus: 12, 19, 24.5, 31.5, 45. Driven: 5, 8, 10.5, 13, 18.

05101520253035Walking commute (minutes)min 4Q1 = 7median 10Q3 = 14whisker ends at 15outlier 31upper fence 24.5IQR = 7
The walking group as a modified box plot. The upper fence (24.5) is not drawn on a real box plot; it is shown here to explain why 31 appears as a separate dot and the whisker stops at 15.
05101520253035404550Commute time to school (minutes)Commute times by travel modeWalk (n = 11)Bus (n = 12)Driven (n = 10)
Side-by-side box plots on one scale. The bus box sits far to the right and is much wider: bus riders have longer and more variable commutes.

How to compare groups

When you compare side-by-side box plots, cover these points, always in context and with numbers:

  1. Centre: compare the medians.
  2. Spread: compare the IQRs (and ranges, with care if there are outliers).
  3. Shape: is each distribution roughly symmetric, or skewed? A longer right whisker and a median near the left of the box suggest right skew.
  4. Overlap: do the boxes overlap a lot or hardly at all? Little overlap means a clearer difference between groups.
  5. Outliers: note them and think about what they might mean.

Then state a conclusion about the relationship: does the category seem to be associated with the numerical variable?

Worked example

Example 2: Writing the comparison

Compare the commute times for the three modes.

  1. Centre: bus riders have the longest typical commute (median 24.5 min), more than double that of walkers (10 min) and driven students (10.5 min).
  2. Spread: bus commutes vary most (IQR 12.5 min). Walkers (IQR 7) and driven students (IQR 5) are more consistent.
  3. Overlap: the bus box (19 to 31.5) does not overlap the walk box (7 to 14) or the driven box (8 to 13) at all. Walk and driven overlap almost completely.
  4. Outliers: one walker takes 31 min, unusually long for walking. It could be a long route, or a student who stops on the way.
  5. Shape: the bus distribution has a long right whisker (31.5 to 45), suggesting slight right skew.

Travel mode is associated with commute time: bus riders take clearly longer and vary more, while walking and being driven give similar typical times. (With only 10 to 12 students per group, this is a small sample from one school.)

Worked example

Example 3: What box plots hide

Two classes have box plots with exactly the same five-number summary for a test: 52, 64, 73, 81, 95. Can you conclude that the classes did equally well?

  1. The same five numbers means the same minimum, quartiles, median and maximum.
  2. But a box plot does not show how many students are in each group, the mean, or how values are spread inside each quarter.
  3. One class could have many marks bunched near 64 and 81, the other could be spread evenly.

Not entirely. Box plots summarize; they hide group sizes and detail. Report n for each group and, if needed, show histograms or dot plots as well.

Box plots with technology

  • Desmos: type boxplot([4, 6, 7, ...]) for each group. Use the same window for all of them.
  • Spreadsheets: recent versions of Excel have a Box and Whisker chart; Google Sheets users often make box plots with a candlestick chart or an add-on.
  • Statistics Canada and many news sites use box plots or similar range charts to compare provinces and groups.

Whatever tool you use, check that all the boxes share one scale.

Just for fun

Why did the box plot never win an argument? It always admitted that half of its data were outside the box.

Hands-on activity

Timing a household task

You need: a timer (phone or kitchen timer), paper and a pencil.

Pick a simple task everyone in your household can do, such as tying a shoe, folding a towel or making a sandwich (careful with knives; a butter knife is fine). Time it in two groups, for example the dominant hand vs the other hand for tying a knot, or morning vs evening.

  1. Collect at least 8 times for each group (people can repeat the task).
  2. Find the five-number summary for each group and check for outliers with the 1.5 × IQR rule.
  3. Draw side-by-side box plots on one scale on graph paper.
  4. Write a comparison covering centre, spread, overlap and outliers, and a conclusion.

What to look for: the dominant-hand group usually has a smaller median and less spread. If one time is very long because someone was interrupted, it may show up as an outlier: say so in your comparison.

Your turn

1

Find the five-number summary of 3, 5, 6, 8, 9, 10, 12, 13, 20.

2

Are there outliers in the data from the previous question?

3

Grade 9 sleep (hours): 6.5, 7.5, 8, 8.5, 9.5. Grade 12 sleep: 5, 6, 6.5, 7, 8. Compare the medians and ranges.

4

Two box plots barely overlap. What does that suggest about the relationship between the category and the numerical variable?

5

Why must side-by-side box plots share one scale?

6

A box plot has a median close to Q1 and a long right whisker. Describe its shape.

More practice: warm-up

1

What is the IQR if Q1 = 12 and Q3 = 20?

2

With Q1 = 12 and Q3 = 20, what is the upper fence?

3

Which statistic do you compare for centre in box plots?

4

Name a display for one categorical and one numerical variable.

5

What percent of the data lies inside the box?

More practice: on your own

1

Find the five-number summary and outliers for: 22, 25, 26, 28, 29, 30, 31, 33, 34, 52.

2

Battery life (h) for Phone A: 8, 11, 12, 14, 18; Phone B: 12, 13, 13.5, 14, 15. Compare.

3

A report compares median house prices in two towns with box plots but does not give the number of sales in each town. Why does that matter?

4

Snowfall totals (cm) for 12 winters in Town X have Q1 = 120, median = 150, Q3 = 170; Town Y has Q1 = 160, median = 190, Q3 = 230. Describe the overlap and what it suggests.

5

Explain why the mean of the walking group (about 11.5 min) is larger than its median (10 min).

Challenge

1

Data set: 10, 12, 14, 15, 16, 18, 20, x (with x > 20). For what values of x is x an outlier?

2

Design two small data sets (5 values each) with the same median and IQR but different ranges, and explain how their box plots differ.

3

Explain how side-by-side box plots relate to correlation, and why r cannot be used here.

Check your understanding

Quiz

1.

Which display best shows how sleep hours differ across Grades 9, 10, 11 and 12?

2.

Q1 = 30 and Q3 = 50. Which value is an outlier?

3.

Two box plots have medians 40 and 41 and almost identical boxes. The best conclusion is:

4.

What does a box plot NOT show?

5.

For 2, 4, 6, 8, 10, 12, 14, what is Q1?

6.

A whisker in a modified box plot ends:

For parents and teachers

Big idea (D2.3, D2.5): to see how a numerical variable depends on a category, draw side-by-side box plots on one scale and compare centre, spread, shape, overlap and outliers.

How to help: Ask your teen to read one of their box-plot comparisons aloud. A good one uses numbers and context ("bus riders' median was 24.5 minutes, more than double...") rather than "the bus one is bigger".

Common difficulties:

  • Using different quartile methods without noticing (this course leaves the median out of both halves when n is odd).
  • Drawing the whisker to an outlier instead of to the last value inside the fence.
  • Comparing only medians and ignoring spread and overlap.
  • Forgetting that box plots hide group sizes.