Comparing Distributions and z-Scores
How to compare two or more distributions of the same quantitative variable with dotplots, histograms, boxplots and back-to-back stem-and-leaf plots, write comparisons that actually compare, and use z-scores to compare the positions of single values.
To compare groups, put their graphs on the same scale and compare the same four features: shape, center, variability, and unusual features. Every sentence should compare, using words like “greater than” or “more variable than.” To compare where single values stand, convert them to z-scores: how many standard deviations above or below the mean each value is.
1How to compare two distributions
A survey asked 20 ninth graders and 20 twelfth graders at one school how many hours they slept last school night. The question is whether the two grades differ.
| Grade | n | Min | Q1 | Median | Q3 | Max | Mean | SD | IQR |
|---|---|---|---|---|---|---|---|---|---|
| 9th | 20 | 6.5 | 7.5 | 8.25 | 9.0 | 10.0 | 8.25 | 0.92 | 1.5 |
| 12th | 20 | 4.5 | 6.0 | 7.0 | 8.0 | 11.5 | 7.10 | 1.67 | 2.0 |
A comparison covers the same four features as a description, but each one is stated as a comparison between the groups.
| Feature | A comparing sentence |
|---|---|
| Shape | “Both distributions are roughly symmetric.” |
| Center | “The median for 9th graders is 1.25 hours greater than for 12th graders.” |
| Variability | “Twelfth graders’ sleep times are more variable than ninth graders’ (IQR 2 hours compared with 1.5 hours).” |
| Unusual features | “Only the 12th grade data have an outlier, at 11.5 hours.” |
“The 9th grade median is 8.25. The 12th grade median is 7.” Both sentences are true, but neither compares. Join them with a comparing word and the size of the difference: “The 9th grade median is 1.25 hours greater than the 12th grade median.”
2Dotplots and histograms side by side
Dotplots, histograms and stem-and-leaf plots show every feature: center, variability, shape, outliers, clusters and gaps. To compare two groups, stack their graphs on the same number line.
If one dotplot runs from 4 to 12 hours and the other from 6 to 10, the second one’s values look more spread out than they are. Always draw comparison graphs on one shared axis, or at least the same scale.
3Parallel boxplots
Boxplots drawn on one axis compare center, variability, outliers, and skewness or symmetry at a glance. They are especially handy for three or more groups. They do not show clusters, gaps, or sample sizes.
Sleep by grade
Use Figures 1 and 2 and the summary statistics in the table above. Compare the distributions of school-night sleep for the 20 ninth graders and the 20 twelfth graders.
- 1Shape: the 9th grade distribution is roughly symmetric. The 12th grade distribution is roughly symmetric apart from one high value.
- 2Center: the 9th graders’ median (8.25 hours) is greater than the 12th graders’ (7 hours), by 1.25 hours.
- 3Variability: the 12th graders’ sleep is more variable: IQR 2 hours against 1.5 hours, and range 7 hours against 3.5 hours.
- 4Unusual features: the 12th graders have an outlier at 11.5 hours (upper fence 11 hours); the 9th graders have no outliers.
“Most 9th graders sleep more than a typical 12th grader.”
Use the parallel boxplots in Figure 2. Is the claim supported?
- 1A typical 12th grader sleeps about the 12th grade median, 7 hours.
- 2The 9th grade Q1 is 7.5 hours. About 75% of 9th graders sleep at least 7.5 hours, which is more than 7 hours.
- 375% is more than half, so “most” is justified.
Back a claim with numbers from the graphs and name both groups: “About 75% of the 9th graders sleep at least 7.5 hours, more than the 7-hour median for 12th graders.”
4Back-to-back stem-and-leaf plots
A back-to-back stem-and-leaf plot puts the stems in the middle and the two groups’ leaves on either side. It shows both shapes next to each other and keeps every value.
Read the left side carefully. Its leaves belong to the stem on their right and grow outward from it, so a left leaf of 5 next to stem 8 means 8.5 hours, just as a right leaf of 5 next to stem 8 does.
5z-scores
A z-score measures how many standard deviations a data value falls above or below the mean. It is also called a standardized score.
Here \(x_i\) is the data value, \(\mu\) (the Greek letter mu) is the population mean, and \(\sigma\) (sigma) is the population standard deviation. A positive z-score means the value is above the mean; a negative one means below. A z-score of 0 is exactly at the mean.
When the population mean and standard deviation are unknown, use the sample mean \(\bar{x}\) and sample standard deviation \(s\) instead.
Reaction time
A reaction-time test has scores that, for all teens who take it, have mean \(\mu = 250\) milliseconds and standard deviation \(\sigma = 30\) milliseconds. A student’s time is 205 ms. Find and interpret the z-score.
- 1\(z = \dfrac{x - \mu}{\sigma} = \dfrac{205 - 250}{30} = \dfrac{-45}{30} = -1.5\).
- 2The sign tells the direction: negative means below the mean.
- 3For reaction time, lower is faster, so this student is faster than average.
Reaction time again
Using \(\mu = 250\) ms and \(\sigma = 30\) ms, what reaction time has a z-score of \(-2\)?
- 1Solve \(z = \dfrac{x - \mu}{\sigma}\) for \(x\): \(x = \mu + z\sigma\).
- 2\(x = 250 + (-2)(30) = 250 - 60 = 190\) ms.
Interpret a z-score with its size, its direction, and the context: “The student’s reaction time of 205 ms is 1.5 standard deviations below the mean reaction time for teens.”
A z-score only says above or below the mean. Whether that is good depends on the variable: a negative z-score on reaction time or golf strokes is good, and a positive z-score on a test is good. Interpret the direction in context.
6Comparing positions with z-scores
z-scores compare where single values stand, within one distribution or across different distributions. Raw values from different tests or different groups cannot be compared fairly, because the means and spreads differ. Measured in standard deviations, they can.
Biology or chemistry?
A student scored 82 on a biology test (class mean 74, standard deviation 5) and 88 on a chemistry test (class mean 80, standard deviation 8). On which test did the student do better compared with the class?
- 1Raw scores cannot answer this: the tests have different means and spreads.
- 2Biology: \(z = (82 - 74) \div 5 = 1.6\).
- 3Chemistry: \(z = (88 - 80) \div 8 = 1.0\).
- 4A larger z-score means farther above the class mean, measured in standard deviations.
9.5 hours of sleep
One 9th grader and one 12th grader each slept 9.5 hours. Using each grade’s sample mean and standard deviation from the table, who is more unusual within their own grade?
- 1When the population values are unknown, use the sample mean and standard deviation.
- 29th grader: \(z = (9.5 - 8.25) \div 0.92 \approx 1.36\).
- 312th grader: \(z = (9.5 - 7.10) \div 1.67 \approx 1.44\).
Each z-score uses the mean and standard deviation of the distribution its value comes from. The biology score is standardized with the biology mean and SD, the chemistry score with the chemistry mean and SD. Mixing them gives a number that means nothing.
Quick reference
| Tool | Use it to compare |
|---|---|
| Dotplots, histograms, stem-and-leaf plots on one scale | Center, variability, shape, outliers, clusters, gaps |
| Back-to-back stem-and-leaf plot | Two groups’ shapes, with every value kept |
| Parallel boxplots | Center, variability, outliers, skewness or symmetry |
| Summary statistics | Precise differences in center and variability |
| \(z = (x_i - \mu) / \sigma\) | Where single values stand, within or between distributions |