Statistics · Representations of Data · Year 1

Comparing Data

Comparing two datasets properly means saying something about both where the data is centred and how spread out it is — one without the other is only half an answer.

9 min read 4 worked examples

Comparing location and spread

When comparing two datasets, always comment on both of the following:

  • a measure of location (typically the mean or the median), and
  • a measure of spread (typically the standard deviation or the interquartile range).

A comparison using only one of these tells half the story. Exam mark schemes for "compare the two distributions" questions consistently expect a statement about location and a statement about spread.

Which pair of statistics to use

The mean and standard deviation use every value in the dataset, so they're the most informative choice when the data is reasonably symmetric and free of extreme values. If a dataset contains extreme values or is heavily skewed, the mean and standard deviation can be distorted by those extremes — the median and interquartile range are more resistant, and so are usually the more appropriate choice in that case.

Watch out

Don't mix the two pairings — comparing one dataset's mean against another dataset's median, for instance, or a standard deviation against an interquartile range. Use the same pair of statistics (mean & SD, or median & IQR) for both datasets throughout a comparison.

Comparing box plots

When two datasets are presented as box plots, the median gives the location comparison directly, and the width of the box (the interquartile range) — together with the overall span of the whiskers — gives the spread comparison. Always write the comparison in the context of the question, not just as bare numbers.

Worked example 1

Comparing using mean and standard deviation
Daily rainfall ($x$ mm) in April is recorded at two stations. For Station A, $n=30$, $\sum x=186$, $\sum x^2=1360$. For Station B, the mean is $6.5$ mm with a standard deviation of $1.8$ mm. Compare rainfall at the two stations.
MethodFind Station A's mean and SD, then compare both pairs
1
Station A: $\bar x = 186/30=6.2$ mm.
Mean from the summary totals.
2
Variance $=\dfrac{1360}{30}-6.2^2\approx 45.33-38.44=6.89$, so $\sigma\approx 2.625$ mm.
Computational variance formula.
3
Station B's mean ($6.5$ mm) is higher than Station A's ($6.2$ mm), so Station B typically receives slightly more rainfall.
Compares location.
4
Station A's standard deviation ($\approx2.625$ mm) is larger than Station B's ($1.8$ mm), so rainfall at Station A is more variable from day to day.
Compares spread.
▪ compared

Worked example 2

Choosing median and IQR over mean and SD
House prices (£1000s) on two streets are compared using the median and interquartile range, since a small number of unusually expensive houses would otherwise distort a comparison based on the mean. Street A: median $=310$, $\text{IQR}=45$. Street B: median $=295$, $\text{IQR}=70$. Compare typical price and consistency, and explain why median and IQR were chosen.
MethodCompare medians, then IQRs, then justify the choice
1
Street A's median ($£310{,}000$) is higher than Street B's ($£295{,}000$), so a typical house on Street A costs more.
Compares location.
2
Street A's IQR ($£45{,}000$) is smaller than Street B's ($£70{,}000$), so house prices on Street A are more consistent.
Compares spread.
3
A single very expensive house would pull the mean upward and inflate the standard deviation, without necessarily reflecting a typical property — the median and IQR aren't affected this way.
Justifies why median/IQR were the right choice here.
▪ compared

Worked example 3

Comparing two box plots
Box plots for exam scores are drawn for two classes. Class A: minimum $40$, $Q_1=58$, median $68$, $Q_3=76$, maximum $88$. Class B: minimum $25$, $Q_1=50$, median $65$, $Q_3=80$, maximum $95$. Compare the two classes' performance and consistency.
MethodCompare medians for typical performance, IQRs for consistency
1
Class A's median ($68$) is higher than Class B's ($65$), so a typical student in Class A scored higher.
Median compares location.
2
Class A's IQR $=76-58=18$. Class B's IQR $=80-50=30$.
IQR from each box plot.
3
Class A's IQR is smaller, so Class A's middle 50% of scores are more tightly clustered — Class A performed both slightly better and more consistently than Class B.
Combines both comparisons into one conclusion.
▪ compared

Worked example 4

Why an extreme value changes which statistics to trust · Challenge
The salaries (£1000s) of nine employees at a small company are: $28, 30, 31, 33, 34, 36, 38, 40, 320$ (the last value is the company's founder). Find the mean and the median, and explain which better represents a "typical" salary at this company.
MethodCalculate both, then compare what they represent
1
$\sum x = 28+30+31+33+34+36+38+40+320=590$, so mean $=590/9\approx 65.6$.
Sum of all nine salaries divided by n.
2
$n=9$, so the median is the 5th value in the ordered list: $34$.
Middle value of the ordered data.
3
The mean ($\approx£65{,}600$) is higher than eight of the nine salaries — it's been pulled upward by the founder's salary alone.
One extreme value distorts the mean.
4
The median ($£34{,}000$) is unaffected by the size of the founder's salary — only its position in the ordering matters — so it much better represents what a typical employee earns.
The median is resistant to extreme values.
▪ explained
Look deeper

The standard deviation here would also be enormous, and equally misleading as a description of how salaries vary among the eight regular employees. Whenever a single value could dominate a mean-and-SD comparison like this, the median and IQR give a far more honest picture.

Common mistake

A comparison that only states numbers ("Class A: 68, Class B: 65") without interpreting them in context rarely earns full marks. Always finish with a sentence stating what the numbers mean for the actual situation described in the question.

Check yourself

Two vending machines' fill times (seconds) are compared. Machine A: mean $=12.4$, SD $=0.9$. Machine B: mean $=12.1$, SD $=2.6$. Compare the two machines.
(Hint: compare the means for typical fill time, then the SDs for consistency.)

Method
1
Machine A's mean fill time ($12.4$s) is slightly higher than Machine B's ($12.1$s).
2
Machine A's SD ($0.9$s) is much smaller than Machine B's ($2.6$s), so Machine A fills more consistently.
3
Machine B is slightly faster on average, but far less consistent than Machine A.
Combines both comparisons.
▪ solved