Unit 1 · Topic 1.9 Beta

Comparisons of the Distributions for One Quantitative Variable

4 min read · freeNot practiced

Most questions in statistics compare groups: do patients on a new schedule wait less? Is one bus route more reliable? This topic covers two kinds of comparison. First, comparing whole distributions, feature by feature. Second, comparing single values that come from different distributions, using z-scores and percentiles.

Comparing distributions

Put the groups on the same scale: parallel boxplots, dotplots stacked on one axis, or histograms with the same bins. Then compare every feature you would describe for one distribution:

The single most common lost point: listing numbers without comparing them. "Route 1’s median is 31 and Route 2’s is 28" describes; it does not compare. Use a comparing word: greater, less, more variable, less variable, similar.

Top: parallel boxplots of delivery times in minutes for two restaurants, 15 orders each. Restaurant A has median 32 and a narrow box from 28 to 36. Restaurant B has a lower median, 27, a wider box from 23 to 37, a long right whisker and one high outlier at 60. Bottom: a z-score number line from minus 3 to plus 3 with the mean at 0; a value with z = 1.5 sits 1.5 standard deviations above the mean.
Figure 1. Parallel boxplots of delivery times at two restaurants, and a z-score shown on a number line. LevlPrep original diagram.

Compare two distributions. A commuter timed 15 trips on each of two bus routes. Route 1 (minutes): Q1=28Q_1 = 28, median 31, Q3=34Q_3 = 34, whiskers from 24 to 39, no outliers. Route 2: Q1=23Q_1 = 23, median 28, Q3=38Q_3 = 38, whiskers from 18 to 45, one outlier at 62.

Shape: Route 2 is skewed right with a high outlier; Route 1 is roughly symmetric.

Center: Route 1 has the greater median travel time, 31 minutes against 28.

Spread: Route 2 is much more variable, with an IQR of 38−23=1538 - 23 = 15 minutes against 34−28=634 - 28 = 6 minutes.

In context: "Trips on Route 1 have a greater median time than trips on Route 2 (31 against 28 minutes), but Route 2’s times are far more variable (IQR 15 against 6 minutes). Route 2 is skewed right with an outlier at 62 minutes, while Route 1 is roughly symmetric with no outliers."

A claim from the data: if the commuter must arrive within 40 minutes every day, Route 1 is the better choice, because all 15 of its trips took 39 minutes or less, while 3 of Route 2’s trips took more than 40.

One more trap: you cannot combine two groups by averaging their medians. The median of the combined data depends on every value and on the size of each group.

Relative position: z-scores

Ana scored 86 on a test in class A; Ben scored 88 on a different test in class B. Who did better? The raw scores cannot answer this, because the tests differ. What we can compare is how far each score stands above its own class, measured in a unit that adjusts for each class’s spread: the standard deviation.

The z-score of a value is

z=x−x¯sz = \frac{x - \bar{x}}{s}

using the sample mean and standard deviation (or x−μσ\frac{x - \mu}{\sigma} when the population values are known). It counts how many standard deviations the value is above (positive) or below (negative) the mean.

Compare with z-scores. Class A has mean 74 and standard deviation 8; class B has mean 81 and standard deviation 4.

Ana: zz=86−748= \frac{86 - 74}{8}=128= \frac{12}{8}=1.5= 1.5.

Ben: zz=88−814= \frac{88 - 81}{4}=74= \frac{7}{4}=1.75= 1.75.

Interpretation in context: "Ana’s score is 1.5 standard deviations above the mean score of class A, and Ben’s score is 1.75 standard deviations above the mean score of class B."

Conclusion: relative to his class, Ben did better. Ana is 12 points above her mean and Ben only 7, but class B’s scores vary less, so 7 points there is the larger achievement.

A z-score has no units, since the top and bottom of the fraction are in the same units. Converting heights from inches to centimeters leaves every z-score the same. You can also run the formula backward: the value with z-score −0.5-0.5 when the mean is 60 and the standard deviation is 10 is 60+(−0.5)(10)=5560 + (-0.5)(10) = 55.

Relative position: percentiles

A percentile is the other measure of relative position: a height at the 90th percentile of a class is at or above 90% of the heights in that class. Like a z-score, a percentile describes position within its own group. Kai at the 90th percentile of his class and Lena at the 85th percentile of hers does not tell you who is taller in centimeters.

z-scorePercentile
Tells youstandard deviations above or below the meanpercent of values at or below
Needsthe mean and standard deviationthe ordered data
Signnegative below the meanalways from 0 to 100

Spot a mistake on this page?