Split the data in half, then split each half again.
The data
3, 7, 8, 12, 13, 14, 18, 21, 22, 25
Find Q1.
With ten values the median falls between the 5th and 6th (13.5), splitting the list into two halves of five. Q1 is the median of the lower five — 3, 7, 8, 12, 13 — which is 8. B averages 8 and 12, interpolating where a clean middle value already exists.
1
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
37812131418212225
five below, five above
2
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.
3
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.
4
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.
5
Reading the box plot.
Part of the plot
Holds
left whisker
the bottom 25%
the box
the middle 50%
right whisker
the top 25%
line in the box
the 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.
6
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
7
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?
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.
8
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 value
Quartiles
IQR
add or subtract c
move by c
unchanged
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 Q13, 7plus the 8 itself
Q1 to median12, 13—
median to Q314, 18—
above Q322, 25roughly 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?
Q1 = 16.5 and Q3 = 29.5, so the IQR is 13 and the upper fence is Q3 + 1.5 × IQR = 29.5 + 19.5 = 49. Since 45 < 49 it is not an outlier. A judges by eye — the 1.5 × IQR rule exists precisely so that "looks far away" is not the test.