Free lesson

Every lesson is free, no account needed. Make a free account to save your progress.

Live classGet practice + mocks
  1. Home
  2. Lesson Library
  3. Quartiles and box plots
UPCAT Math Review · Statistics

Quartiles and Box Plots

Split the data in half, then split each half again.

The data

3, 7, 8, 12, 13, 14, 18, 21, 22, 25

Find Q1.

Sort first, then find the middle.

This list is already in order. If it were not, that would be step zero.

n = 10, so the middle is between the 5th and 6th

an even count

(13 + 14) ÷ 2

average the two

median = 13.5

also called Q2

378 1213 141821 2225

five below, five above

Quartiles are the medians of the halves.

lower half: 3, 7, 8, 12, 13

five values

Q1 = 8

the middle one

upper half: 14, 18, 21, 22, 25

the other five

Q3 = 21

its middle

When the count is odd

The median itself is left out of both halves. For 7 values the median is the 4th, and each half has the remaining three.

The interquartile range.

IQR = Q3 − Q1

the spread of the middle half

= 21 − 8 = 13

where half the data lives

range

25 − 3 = 22

one wild value ruins it

IQR

13

ignores both extremes

The IQR is the resistant measure of spread, just as the median is the resistant measure of centre.

Testing for outliers.

1.5 × IQR = 19.5

the fence distance

lower fence = 8 − 19.5 = −11.5

Q1 minus it

upper fence = 21 + 19.5 = 40.5

Q3 plus it

nothing outside → no outliers

3 and 25 are both inside

Q1 = 8 · median 13.5 · Q3 = 21 · IQR = 13

Add a value of 60 and the upper fence still sits at 40.5 — 60 would be flagged as an outlier while the quartiles barely move.

Reading the box plot.

38 13.521 25 whiskerthe box holds the middle 50%
Part of the plotHolds
left whiskerthe bottom 25%
the boxthe middle 50%
right whiskerthe top 25%
line in the boxthe median

A long whisker does not mean more data

Each quarter holds the same number of values. A stretched whisker means those values are spread out, not that there are more of them.

An odd count, worked through.

9 values: median = 5th value = 13

leave it out of both halves

lower half 4, 6, 9, 10: Q1 = 6 + 92 = 7.5

four values, so average the middle two

upper half 15, 16, 20, 24: Q3 = 16 + 202 = 18

IQR = 18 − 7.5 = 10.5

Variations: unsorted with repeats, a low value that is not an outlier.

Unsorted, with a repeat, halves of four. Find Q1, Q3 and the IQR of 7, 3, 9, 3, 12, 5, 10, 6.

sorted: 3, 3, 5, 6, 7, 9, 10, 12

both 3s stay in

lower half 3, 3, 5, 6: Q1 = (3 + 5) ÷ 2 = 4

even half: average the middle two

upper half 7, 9, 10, 12: Q3 = (9 + 10) ÷ 2 = 9.5

the median 6.5 splits the halves

IQR = 9.5 − 4 = 5.5

What is different: sort first and keep every copy of a repeated value. With 8 values each half has 4, so the quartiles themselves are averages.

Dropping the repeat

Writing the 3 once leaves seven values: 3, 5, 6, 7, 9, 10, 12, with Q1 = 5 and Q3 = 10. Every value counts, however many times it appears.

Backwards, with an unknown value: 2, 5, y, 9, 12, 14, 17, 21 are in order and Q1 = 6. The lower half is 2, 5, y, 9, so Q1 = (5 + y) ÷ 2 = 6, giving y = 7. Check the order: 5 ≤ 7 ≤ 9 ✓.

A low value under test. Is 2 an outlier in 2, 18, 20, 21, 24, 26, 30, 31, 33?

median = 24; Q1 = (18 + 20) ÷ 2 = 19, Q3 = (30 + 31) ÷ 2 = 30.5

9 values: leave 24 out of the halves

IQR = 11.5, 1.5 × IQR = 17.25

the fence distance

lower fence = 19 − 17.25 = 1.75

the side that matters for 2

2 > 1.75: not an outlier

it sits just inside

What is different: the suspect value is at the bottom, so the lower fence decides. Looking far from the rest is not enough; only the fence test counts.

What happens to the IQR when the data change.

× 3: every gap triples, so the IQR becomes 18

Q1 and Q3 both triple

− 4: both quartiles move down 4

the gap between them does not change

new IQR = 18

Change to every valueQuartilesIQR
add or subtract cmove by cunchanged
multiply by k (k > 0)× k× k

Applying the − 4 to the IQR

14 takes the 4 off the gap. Shifting every value moves Q1 and Q3 together, so their difference stays the same.

On the exam

Expect Q1 and Q3 of a short list (odd and even counts), a box plot to read, the 1.5 × IQR outlier fences, or the effect of a change to every value. Sort first, and leave the median out of both halves when the count is odd. Ten-second check: Q1 ≤ median ≤ Q3, and about half the data lie between Q1 and Q3.

Check: count into each quarter.

below Q1 3, 7 plus the 8 itself
Q1 to median 12, 13 —
median to Q3 14, 18 —
above Q3 22, 25 roughly a quarter each ✓

Remember the flow

Sort · Median · Median of each half · IQR

Outlier fences sit 1.5 IQR beyond the box.
Now you try

Practice problem

The data

12, 15, 18, 20, 22, 25, 28, 31, 45

Is 45 an outlier?