Why compare distributions?
Many statistical questions are about differences between groups. Do seedlings grow taller under one lamp than another? Do customers at one café wait longer than at another? To answer, you collect values of the same quantitative variable for each group and compare the distributions.
A good comparison does three things:
- It uses representations drawn on the same scale, so that equal distances mean equal amounts.
- It compares the four main features: shape, centre, variability and unusual features (outliers, clusters, gaps).
- It uses comparative words (“greater than”, “less variable”, “more skewed”), gives values for both groups, and stays in context with units.
Listing two medians side by side is not a comparison. “The median height under Lamp A (24 cm) is 5 cm greater than under Lamp B (19 cm)” is.
The data set used in this guide
At the fictional Thornbury College greenhouse, 30 seedlings of the same plant were split into two groups of 15. One group grew under Lamp A and the other under Lamp B. After three weeks the height of each seedling was measured, in centimetres. All values are invented for this guide.
- Lamp A: 17, 19, 20, 21, 22, 23, 24, 24, 25, 26, 27, 28, 29, 31, 33
- Lamp B: 12, 14, 15, 15, 16, 17, 18, 19, 21, 23, 26, 29, 33, 38, 52
Summary statistics (quartiles found by leaving the median out of each half, as in Topic 1.7):
| Lamp | n | Min | Q1 | Median | Q3 | Max | IQR | Mean x̄ | s |
|---|---|---|---|---|---|---|---|---|---|
| A | 15 | 17 | 21 | 24 | 28 | 33 | 7 | 24.60 | 4.50 |
| B | 15 | 12 | 15 | 19 | 29 | 52 | 14 | 23.20 | 10.92 |
All values are in centimetres.
Which display shows which feature?
Each type of graph is good at showing some features and blind to others.
| Display | Centre | Variability | Shape | Outliers | Clusters and gaps |
|---|---|---|---|---|---|
| Dot plots on a common axis | yes | yes | yes | yes | yes |
| Back-to-back stem-and-leaf plot | yes | yes | yes | yes | yes |
| Histograms on the same scale | yes | yes | yes | yes | yes |
| Parallel (side-by-side) boxplots | yes | yes | skewness or symmetry only | yes | no |
A boxplot is drawn from just five numbers (plus any outliers). It cannot show where values bunch together inside the box or along a whisker, so clusters and gaps are hidden. It also does not show how many values there are.
When the groups have different sizes, compare histograms using relative frequency (proportion or percentage in each interval), not raw counts. Otherwise the bigger group looks larger in every bar.
A back-to-back stem-and-leaf plot
In a back-to-back stemplot, the stems run down the middle. Leaves for one group go to the right; leaves for the other go to the left, and are read from the stem outwards.
| Lamp A leaves | Stem | Lamp B leaves |
|---|---|---|
| 9 7 | 1 | 2 4 5 5 6 7 8 9 |
| 9 8 7 6 5 4 4 3 2 1 0 | 2 | 1 3 6 9 |
| 3 1 | 3 | 3 8 |
| 4 | ||
| 5 | 2 |
Key: 1 | 2 | 3 means 21 cm for Lamp A and 23 cm for Lamp B.
You can read straight off this display that Lamp A’s heights are bunched in the 20s, while Lamp B’s are piled up in the teens and trail off to the right. The empty stem 4 shows a gap: no Lamp B seedling grew between 39 and 51 cm, and then one grew to 52 cm.
Parallel boxplots
Reading the boxplots:
- Centre: compare the median lines. Lamp A’s median (24 cm) is to the right of Lamp B’s (19 cm).
- Variability: compare box widths (IQR) and overall lengths (range). Lamp B’s box is twice as wide.
- Skewness: for Lamp B, the median is close to the left end of the box and the right whisker is long, so the distribution is skewed to the right. Lamp A’s median sits near the middle of its box and the whiskers are similar in length, so it is roughly symmetric.
- Outliers: only Lamp B has one (52 cm).
Notice what the boxplots do not show: the gap between 38 and 52 cm, and how tightly Lamp B’s heights cluster in the teens. That is why the stemplot and the boxplots together tell a fuller story than either alone.
Using summary statistics in a comparison
You can include any numerical summary in a comparison: medians, quartiles, IQRs, means, standard deviations, ranges. Choose statistics that suit the shapes. Lamp B is skewed with an outlier, so the median and IQR are the fairer pair here (they are resistant). The means (24.60 cm and 23.20 cm) are only 1.4 cm apart because the 52 cm seedling pulls Lamp B’s mean up. Lamp B’s standard deviation (10.92 cm) is also inflated by that one seedling: without it, s drops to about 7.75 cm.
If both distributions were roughly symmetric with no outliers, comparing means and standard deviations would be fine.
Z-scores: relative position
Sometimes you want to know how unusual one individual value is. Being 9 cm above the mean is remarkable if values usually differ from the mean by 2 cm, but ordinary if they usually differ by 15 cm. A z-score (standardised score) measures distance from the mean in units of standard deviations:
z = (x − μ) / σ
Here x is the value you want to place, μ is the mean of the whole population and σ is its standard deviation. If you only have a sample, use the sample mean x̄ and sample standard deviation s instead: z = (x − x̄) / s.
- A positive z-score means the value is above the mean; a negative z-score means it is below.
- z = 0 means the value equals the mean.
- z has no units: the units of x − μ and σ cancel. This is what lets you compare values measured on different scales, or values from different groups.
You can also reverse the formula to find the value with a given z-score: x = μ + zσ.
Z-scores do not require a particular shape. Using them with the normal distribution to find percentages comes later, in Topic 2.11.
Worked example 1: comparing the two lamps and judging a claim
Question. The greenhouse manager claims: “Seedlings grow taller under Lamp A.” Write a complete comparison of the two distributions, then say whether the data support the claim.
- Shape. Lamp A’s heights are roughly symmetric (median 24 cm near the middle of the box; leaves spread evenly across the 20s). Lamp B’s heights are skewed to the right: most are in the teens, with a long tail up to 38 cm and one very tall seedling.
- Centre. The median height under Lamp A (24 cm) is 5 cm greater than under Lamp B (19 cm).
- Variability. Lamp B’s heights are much more variable. Its IQR is 14 cm, twice Lamp A’s 7 cm. Its range is 40 cm against 16 cm.
- Unusual features. Lamp B has a potential outlier at 52 cm (beyond the upper fence of 50 cm) and a gap from 39 to 51 cm. Lamp A has no outliers (fences 10.5 cm and 38.5 cm) and no gaps.
- Extra evidence. 13 of the 15 Lamp A seedlings are taller than Lamp B’s median of 19 cm. Only 5 of the 15 Lamp B seedlings are taller than Lamp A’s median of 24 cm.
Conclusion. The data support the claim for a typical seedling: the median height under Lamp A is 5 cm greater, and most Lamp A seedlings are taller than a typical Lamp B seedling. But the claim is not true for every seedling. The tallest seedling of all (52 cm) grew under Lamp B, and Lamp B’s results are far less consistent.
Check. Every sentence names the variable (height), the groups (lamps) and the units (cm), and uses a comparative word. Whether the lamp caused the difference depends on how the seedlings were assigned to the lamps; you will meet that idea in the data-collection topics later in this unit.
Worked example 2: comparing across different events with population parameters
Question. In the fictional Kestrel Valley schools’ athletics league, the results for all competitors this season are:
- Shot put: μ = 9.20 m, σ = 1.10 m
- 800 m run: μ = 152 s, σ = 9 s
Leila threw 10.85 m and ran 800 m in 138 s. Relative to the league, in which event did she perform better?
- Shot put z-score: z = (10.85 − 9.20) ÷ 1.10 = 1.65 ÷ 1.10 = 1.50. Her throw was 1.50 standard deviations above the league mean.
- 800 m z-score: z = (138 − 152) ÷ 9 = −14 ÷ 9 = −1.56 (to 2 d.p.). Her time was 1.56 standard deviations below the league mean.
- Think about direction. In the shot put, a longer throw is better. In a race, a shorter time is better. So a negative z-score for the 800 m is a good result.
- Compare sizes. Her run was 1.56 standard deviations better than the mean; her throw was 1.50 standard deviations better.
Conclusion. Relative to the league, Leila’s 800 m run was very slightly more impressive than her shot put, although the two are close.
Check. You could not compare 10.85 m with 138 s directly: the units differ and “better” points in opposite directions. Z-scores solve both problems. As a reverse check, the time with z = 1.2 would be 152 + 1.2 × 9 = 162.8 s, a slower-than-average run, as expected for a positive z in a race.
Worked example 3: relative position within two samples
Question. The tallest seedling under Lamp A is 33 cm. A seedling under Lamp B is 38 cm. Which seedling is more unusually tall compared with its own group?
The data are samples, so use x̄ and s.
- Lamp A: z = (33 − 24.60) ÷ 4.5008 = 8.40 ÷ 4.5008 ≈ 1.87.
- Lamp B: z = (38 − 23.20) ÷ 10.9231 = 14.80 ÷ 10.9231 ≈ 1.35.
Conclusion. The 33 cm seedling is 1.87 standard deviations above its group mean, compared with 1.35 for the 38 cm seedling. So the 33 cm seedling is more unusually tall within its own group, even though it is the shorter plant. Lamp A’s heights vary much less, so 33 cm stands out more there.
Within one group. z-scores also compare values inside a single distribution. In Lamp B, the 12 cm seedling has z = (12 − 23.20) ÷ 10.9231 ≈ −1.03. So the 38 cm seedling (z ≈ 1.35) lies further from the Lamp B mean than the 12 cm seedling does, even though both look “extreme” on the stemplot.
Common misconceptions
- “A wider box means more data.” Every box holds about half the values of its group. A wider box means more variability, not more data.
- “Boxplots show everything.” They hide clusters, gaps and sample size. Use a dot plot, stemplot or histogram if those features matter.
- Comparing on different scales. Two graphs with different axes can make similar groups look different. Always use a common scale.
- Raw counts for groups of different sizes. Compare proportions (relative frequencies) instead.
- Listing instead of comparing. “A: median 24. B: median 19” is two descriptions. Use a comparative word and say which is greater.
- Forgetting context. Name the variable, the groups and the units in every sentence.
- “A negative z-score is a bad result.” It only means below the mean. For times or errors, below the mean is good.
- “z-scores have the same units as the data.” They have no units.
- “z-scores only work for normal distributions.” You can calculate them for any distribution.
- “The group with the higher median beats the other group every time.” A difference in centres describes typical values; individual values can still overlap.
Where this leads
In Topic 1.10 you return to the investigative question and start to plan how data are collected, which decides whether a difference between groups like the lamps can be generalised or explained by cause. Z-scores return with the normal distribution in Topic 2.11. If you need to revise boxplots first, see the Topic 1.8 study guide; when you are ready, move on to the Topic 1.10 study guide.
Try the practice questions now, then use the revision notes and the checklist to consolidate.
Quick questions
Do I have to mention every feature when I compare two distributions?
A full comparison covers shape, centre, variability and any unusual features. If a question asks about only one feature, such as centre, compare that feature carefully, with values for both groups.
Can I use a z-score if the distribution is not normal?
Yes. A z-score only measures distance from the mean in standard deviations, so you can calculate it for any distribution. Turning a z-score into a percentage of values needs a normal distribution, which comes in Topic 2.11.