Statistics · Measures of Location and Spread · Year 1

Other Measures of Location

The median splits a dataset into two equal halves. Quartiles and percentiles cut it into finer pieces still — quarters and hundredths — giving a much more detailed map of where the data sits.

10 min read 4 worked examples

Quartiles and percentiles

The median divides an ordered dataset into two equal halves. Quartiles divide it into four equal quarters: the lower quartile $Q_1$ sits one-quarter of the way through the data, the median $Q_2$ sits halfway through, and the upper quartile $Q_3$ sits three-quarters of the way through. Percentiles divide the data into 100 equal parts — the $k$th percentile, written $P_k$, has $k\%$ of the data below it.

Finding quartiles for discrete data

For an ordered dataset of $n$ discrete values:

Lower quartile: calculate $\dfrac{n}{4}$. If this is a whole number, $Q_1$ is halfway between that data point and the one above it. If it isn't a whole number, round up and use that data point directly.
Upper quartile: calculate $\dfrac{3n}{4}$. Apply exactly the same rule — halfway between two points if whole, otherwise round up to the next data point.
Why two different rules

When $\frac{n}{4}$ lands exactly on a whole number, that position sits precisely on the boundary between two data points, so $Q_1$ is taken as their average. When $\frac{n}{4}$ isn't whole, the true quarter-way position falls strictly inside a single data point's "slot" in the order, so rounding up picks out that value directly — no averaging needed.

Percentiles for discrete data

The same logic extends to any percentile: to find $P_k$, calculate $\dfrac{k}{100}\times n$ and apply the identical rule — average two points if the result is whole, otherwise round up and read off that data point.

Interpolation for grouped or continuous data

When data is grouped into classes, individual positions can't be read off directly — instead, interpolation is used, assuming the data values are spread evenly across each class. The positions used are:

$Q_1 = \dfrac{n}{4}\text{th value}, \qquad Q_2 = \dfrac{n}{2}\text{th value}, \qquad Q_3 = \dfrac{3n}{4}\text{th value}.$

Once the class containing that position is identified from the cumulative frequencies, the estimate is found by proportion: if the required position lies a fraction of the way from the lower to the upper cumulative frequency of that class, the estimate lies the same fraction of the way between the class's boundaries.

Watch out — no rounding rule for grouped data

The "round up if not whole" rule is only for discrete, ungrouped data, where positions must land on an actual data point. For grouped or continuous data using interpolation, $\frac{n}{4}$, $\frac{n}{2}$ and $\frac{3n}{4}$ are used exactly as calculated, with no rounding — interpolation can estimate a value at any fractional position within a class.

Worked example 1

Quartiles when n/4 is a whole number
Find the median, lower quartile and upper quartile of the ordered dataset ($n=16$):
$12, 14, 15, 15, 17, 18, 18, 19, 20, 21, 22, 23, 24, 25, 27, 29$
MethodApply the position formulae, then the whole-number averaging rule
1
Median: $\dfrac{n+1}{2}=\dfrac{17}{2}=8.5\text{th value} = \dfrac{19+20}{2}=19.5$.
Average of the 8th and 9th values.
2
$\dfrac{n}{4}=\dfrac{16}{4}=4$, a whole number, so $Q_1$ is halfway between the 4th and 5th values: $\dfrac{15+17}{2}=16$.
Whole-number case → average two data points.
3
$\dfrac{3n}{4}=\dfrac{3(16)}{4}=12$, a whole number, so $Q_3$ is halfway between the 12th and 13th values: $\dfrac{23+24}{2}=23.5$.
Same rule applied to the upper quartile.
▪ solved

Worked example 2

Quartiles when n/4 is not a whole number
Find the lower and upper quartiles of the ordered dataset ($n=18$):
$5, 6, 8, 9, 9, 10, 11, 12, 12, 13, 14, 14, 15, 16, 17, 18, 19, 21$
MethodApply the round-up rule since neither position is whole
1
$\dfrac{n}{4}=\dfrac{18}{4}=4.5$, not a whole number, so round up to the 5th value: $Q_1=9$.
Round up, then read off that data point directly.
2
$\dfrac{3n}{4}=\dfrac{3(18)}{4}=13.5$, not a whole number, so round up to the 14th value: $Q_3=14$.
Same rule for the upper quartile.
▪ solved
Examiner's eye

Round up, never down or to the nearest — $4.5$ rounds up to $5$, not down to $4$. Rounding the wrong way is the most common error with this rule.

Worked example 3

A percentile from discrete data
The finishing times of 40 runners in a sprint are recorded in order. The 28th value is $12.4$ seconds and the 29th value is $12.6$ seconds. Find the 70th percentile, $P_{70}$.
MethodApply the percentile position formula
1
Position $= \dfrac{70}{100}\times 40 = 28$, a whole number.
k/100 × n, same structure as the quartile rule.
2
Since the position is whole, $P_{70}$ is halfway between the 28th and 29th values: $\dfrac{12.4+12.6}{2}=12.5$ seconds.
Whole-number case → average the two surrounding values.
▪ solved
The key insight

Quartiles are just specific, commonly-used percentiles: $Q_1=P_{25}$, $Q_2=P_{50}$ (the median), and $Q_3=P_{75}$. Learning the percentile method means you already know how to find any quartile too.

Worked example 4

Interpolation for grouped continuous data · Challenge
The times, $t$ minutes, taken by 60 runners to complete a fun run are grouped below.
Time, $t$ (min)Frequency
$20\le t<30$8
$30\le t<40$19
$40\le t<50$22
$50\le t<70$11

Find estimates for (a) the median, (b) the lower quartile.

MethodLocate the class using cumulative frequency, then interpolate
1
Cumulative frequencies: $8,\ 27,\ 49,\ 60$.
Running total after each class.
2
(a) Median position $= \dfrac{60}{2}=30$, which falls in the class $40\le t<40+10$, since cumulative frequency reaches 27 before this class and 49 by the end of it.
30 lies between 27 and 49.
3
Median $\approx 40 + \dfrac{30-27}{49-27}\times 10 = 40+\dfrac{3}{22}\times 10 \approx 41.36$ minutes.
Proportion of the way through the class, times the class width.
4
(b) Lower quartile position $=\dfrac{60}{4}=15$, which falls in the class $30\le t<40$, since cumulative frequency is 8 before this class and 27 by the end of it.
15 lies between 8 and 27.
5
$Q_1 \approx 30 + \dfrac{15-8}{27-8}\times 10 = 30+\dfrac{7}{19}\times 10 \approx 33.68$ minutes.
Same proportional method, different class.
▪ solved
Look deeper

Interpolation only ever gives an estimate, since it assumes runners are spread perfectly evenly across each class — real data rarely is. Still, it's the best estimate available without the raw, ungrouped times.

Common mistake

Don't apply the discrete "round up" rule to grouped, continuous data, and don't use raw interpolation positions on a small, ungrouped dataset — matching the method to the type of data is the first decision to make, before any calculation begins.

Check yourself

An ordered dataset has $n=24$ values. Find the positions used to locate $Q_1$ and $Q_3$, and state whether each requires averaging or rounding up.
(Hint: calculate n/4 and 3n/4 first.)

Method
1
$\dfrac{24}{4}=6$, a whole number, so $Q_1$ is the average of the 6th and 7th values.
2
$\dfrac{3(24)}{4}=18$, a whole number, so $Q_3$ is the average of the 18th and 19th values.
Both positions land exactly on a whole number here.
▪ solved