Quartiles and the five number summary
The median cuts sorted data into a lower half and an upper half. Where do the cuts go for four quarters, and how wide is the middle half of the data?
Where you are 2 in Range and interquartile range
Why this exists
Carys keeps a reading log of how many pages she reads each week. Her median week says what a typical week looks like, but not how much her weeks vary. A reader who reads 44 to 46 pages every week and one who swings between 10 and 90 can share a median of 45. Telling them apart needs a measure of spread: how far apart the values are.
The quickest measure is the distance from the smallest value to the largest, but it rests on the two most extreme values only, so one unusual week can make it huge. A steadier picture comes from cutting the sorted data into four parts with the same number of values in each, and asking how wide the middle two parts are. The three cut points are the quartiles.
Definition
Sort the data from smallest to largest and find the median, as in Finding the median. The median splits the sorted list into a lower half and an upper half:
- When the number of values n is even, the lower half is the first \displaystyle \frac{n}{2} values and the upper half the last \displaystyle \frac{n}{2}.
- When n is odd, the median is the single middle value. It is left out of both halves, so each half holds \displaystyle \frac{n-1}{2} values.
The first quartile Q_1 is the median of the lower half, and the third quartile Q_3 is the median of the upper half. The median itself is sometimes called the second quartile. Together they cut the sorted data into four parts holding about the same number of values, the quarters of the data.
The five-number summary is the minimum, Q_1, the median, Q_3 and the maximum, always written in that order. Two measures of spread come from it, both in the units of the data (the parent topic is Range and interquartile range). The range is the width of all the data:
The interquartile range, written \text{IQR}, is the width of the middle half:
Intuition
Figure 1 shows the twelve dive times of one penguin from Example 2. The dashed lines are at Q_1 = 60.5, the median 69.5 and Q_3 = 83.5 seconds, and exactly three dives fall in each quarter.
The quarters hold the same number of dives but are not the same width. The first runs from 48 to 60.5, a stretch of 12.5 seconds; the last runs from 83.5 to 104, a stretch of 20.5 seconds. A narrow quarter means values crowded together, a wide one means values spread out. The quartiles cut the data into equal counts, not the number line into equal lengths.
The IQR is the width of the two middle quarters together, 83.5 - 60.5 = 23 seconds, against a range of 104 - 48 = 56 seconds. The range answers “how far apart are the two most extreme dives?” The IQR answers “how far apart are the ordinary dives in the middle?”
Results
Where the quartiles sit. A half with an odd number of values has one middle value, so its quartile is a data value; a half with an even number has two, and the quartile is halfway between them. Q_3 is found like Q_1, counting down from the largest value.
| Values n | Each half | Q_1 | Q_3 |
|---|---|---|---|
| 11 | 5 | 3rd value | 9th value |
| 12 | 6 | halfway, 3rd and 4th | halfway, 9th and 10th |
| 13 | 6 | halfway, 3rd and 4th | halfway, 10th and 11th |
| 14 | 7 | 4th value | 11th value |
The order. Always \text{minimum} \le Q_1 \le \text{median} \le Q_3 \le \text{maximum}.
Half in the middle. About a quarter of the values lie below Q_1, about a quarter above Q_3, and about half from Q_1 to Q_3. When n is a multiple of 4 and no two values are equal, each quarter holds exactly \displaystyle \frac{n}{4} values.
IQR and range. Always 0 \le \text{IQR} \le \text{range}.
Only the ends move the range. With six or more values, making the largest value larger (or the smallest smaller) changes the range and leaves the IQR exactly as it was.
Why it is true
Four quarters. The median splits the sorted list into two halves with the same count, and Q_1 and Q_3 split each half the same way. Two equal halves, each cut into two equal parts, make four parts of equal count. “About” is needed only for values sitting on a cut: a left-out median, a quartile that is itself a data value, or repeats.
The order. The median of any list lies between that list’s smallest and largest values. Every lower-half value is at least the minimum and at most the median, so their median, Q_1, is too. In the same way Q_3 lies between the median and the maximum.
IQR at most the range. The stretch from Q_1 to Q_3 lies inside the stretch from the minimum to the maximum, so it cannot be longer, and it is not negative because Q_1 \le Q_3.
The ends. With six or more values each half holds at least three, and the middle of three or more sorted values never uses the first or last of them. So no cut uses the minimum or the maximum. Making the largest value larger, while it stays the largest, leaves every other value in its place, so the cuts stay put while \text{maximum} - \text{minimum} grows.
Worked examples
The lesson runs over two days. Examples 1 to 3 belong to the first: finding the quartiles and the five-number summary. Examples 4 to 7 belong to the second: the range and the IQR, what each says, and working backwards from them.
Quartiles of an odd number of values
Carys read these numbers of pages in eleven weeks: 34, 52, 41, 60, 28, 45, 38, 70, 49, 55, 31. Find the quartiles and the five-number summary.
SolutionSort the values. With n = 11 the median is in position \displaystyle \frac{11 + 1}{2} = 6. The count is odd, so the median is left out of both halves:
Each half has five values, so its median is its third value: Q_1 = 34 and Q_3 = 55. The smallest value is 28 and the largest 70, so the five-number summary is
Check: two weeks lie below 34, two between 34 and 45, two between 45 and 55, and two above 55. The three cut values are weeks too, and 8 + 3 = 11.
Quartiles of an even number of values
Cedric times twelve dives of one penguin at an aquarium, in seconds: 48, 75, 62, 90, 55, 81, 67, 104, 59, 72, 86, 64. Find the five-number summary.
SolutionSort the times, six to a line:
With n = 12 the middle values are the sixth and seventh, so the median is \displaystyle \frac{67 + 72}{2} = 69.5. The count is even, so nothing is left out: the lower half is the first line and the upper half the second. Each half has six values, so its median is halfway between its third and fourth values: \displaystyle Q_1 = \frac{59 + 62}{2} = 60.5 and \displaystyle Q_3 = \frac{81 + 86}{2} = 83.5.
The five-number summary is 48,\ 60.5,\ 69.5,\ 83.5,\ 104 seconds. None of the three cuts is a data value. Figure 1 shows them.
Quartiles from a dot plot
Figure 2 shows how many strokes Calixta took on each of the 18 holes of a mini golf course. Find the five-number summary.
A dot plot is already sorted, so count with a running total, as for the median. The stacks hold 2, 5, 4, 3, 2, 1, 1 dots, so the running totals are 2, 7, 11, 14, 16, 17, 18: the stack at 2 holds positions 3 to 7, the stack at 3 positions 8 to 11, and the stack at 4 positions 12 to 14.
The median is halfway between the ninth and tenth values, both in the stack at 3, so it is 3. The lower half is positions 1 to 9, with middle position 5, in the stack at 2: Q_1 = 2. The upper half is positions 10 to 18, with middle position 14, in the stack at 4: Q_3 = 4. With 1 the fewest strokes and 8 the most, the five-number summary is
Five holes took exactly 2 strokes, so the quarters cannot hold equal counts here; the quartiles still mark a quarter and three quarters of the way up the sorted data.
Range and IQR, and what they say
Find the range and the IQR of Carys’s eleven weeks from Example 1, and say what each tells her.
SolutionThe five-number summary was 28, 34, 45, 55, 70. The range is 70 - 28 = 42 pages and the IQR is 55 - 34 = 21 pages.
The range says her lightest and heaviest weeks are 42 pages apart. The IQR says that once her lightest quarter and heaviest quarter of weeks are set aside, the weeks left all sit between 34 and 55 pages, within 21 pages of one another. Both are distances in pages, the unit of the data.
One extreme week
In a twelfth week Carys was on vacation and read 180 pages. Add it to her data from Example 1 and find the new range and IQR. Which changed more?
SolutionTwelve values is an even count, so the halves are six and six:
Each quartile is halfway between the third and fourth values of its half: \displaystyle Q_1 = \frac{34 + 38}{2} = 36 and \displaystyle Q_3 = \frac{55 + 60}{2} = 57.5. The range is 180 - 28 = 152 pages and the IQR is 57.5 - 36 = 21.5 pages.
The range went from 42 to 152, more than three and a half times as large, because the holiday week is the new maximum. The IQR went from 21 to 21.5: the quartiles shifted a little only because the count changed, and the vacation week sits at the far end, where neither quartile looks. Why the IQR holds steady like this is taken further in Resistant and non resistant measures.
Same range, different middles
Camilo times eight dives of each of two penguins, in seconds. Penguin A: 55, 90, 52, 58, 30, 57, 60, 54. Penguin B: 64, 30, 81, 44, 90, 36, 53, 72. Find the range and the IQR of each. What does the IQR show that the range hides?
SolutionSort each list:
Both ranges are 90 - 30 = 60 seconds. Each half has four values, so each quartile is halfway between the second and third values of its half. For A, \displaystyle Q_1 = \frac{52 + 54}{2} = 53 and \displaystyle Q_3 = \frac{58 + 60}{2} = 59, so the IQR is 6 seconds. For B, \displaystyle Q_1 = \frac{36 + 44}{2} = 40 and \displaystyle Q_3 = \frac{72 + 81}{2} = 76.5, so the IQR is 36.5 seconds.
By the range the two penguins look the same. The IQR shows that A’s ordinary dives are nearly all the same length, with one very short and one very long dive at the ends, while B’s dives are spread across the whole stretch.
Working back from the summary
Cai’s total strokes for eight rounds of mini golf, sorted, are 38, 41, x, 47, 50, 53, 58, y. The range is 25 and the IQR is 12. Find x, y and the five-number summary.
SolutionThe smallest value is 38 and the largest y, so y - 38 = 25 and y = 63. The upper half is 50, 53, 58, 63, so \displaystyle Q_3 = \frac{53 + 58}{2} = 55.5, which does not depend on x. Since \text{IQR} = Q_3 - Q_1,
The lower half is 38, 41, x, 47, so \displaystyle \frac{41 + x}{2} = 43.5. Half of the sum is 43.5, so the sum is 87 and x = 87 - 41 = 46.
Check: 46 lies between 41 and 47, and 63 is above 58, so the list is still sorted. The median is \displaystyle \frac{47 + 50}{2} = 48.5, and the five-number summary is 38,\ 43.5,\ 48.5,\ 55.5,\ 63.
Boundaries
The data must be numbers. Quartiles need values that can be sorted and that have a halfway point between them.
The rule for an odd count is a choice. This lesson leaves the median out of both halves; some books keep it in both. For 2, 4, 6, 8, 10, 12, 14 the rule here gives the lower half 2, 4, 6 and Q_1 = 4, while keeping the median gives 2, 4, 6, 8 and Q_1 = 5. Spreadsheet programs and some calculators use still other rules. With large data sets they nearly agree; with small ones they can differ. Use one rule throughout so that everyone gets the same answer.
Quarters are only approximate. Every value lands inside one of the four parts, \displaystyle \frac{n}{4} in each, only when n is a multiple of 4 and no values repeat at the cuts. Otherwise some values sit on a cut, as in Example 1.
Very small data sets. One value has no halves and no quartiles. With two or three values each half is a single value, so the IQR equals the range. With four or five values each half holds two, so Q_1 and Q_3 each average an extreme with its neighbor and move when it moves. From six values up they do not.
Spread is not center. 10, 20, 30, 40 and 110, 120, 130, 140 both have range 30 and IQR 20. The range and IQR say how wide the data are, not where they sit, and the IQR says nothing about how far the outer quarters reach.
Where this goes next
The five-number summary is exactly what a box plot draws: a box from Q_1 to Q_3 with a line at the median, and whiskers out to the minimum and maximum. That is Making and reading box plots, and Comparing box plots sets two summaries side by side. The Outliers and the 1.5 IQR rule uses the IQR as a yardstick for “unusually far away”, and the Mean absolute deviation measures spread around the mean instead. Quartiles cut the data a quarter, a half and three quarters of the way up; percentiles cut it at any percent.
Exercises
Exercises 1 to 10 go with the first day, 11 to 18 with the second, and the last group draws on both.
Part 1: quartiles from a list
- Find Q_1, the median and Q_3 of 15, 9, 22, 18, 11, 25, 13.
- Find Q_1, the median and Q_3 of 3, 14, 7, 10, 5, 12, 8, 16.
- Cai read these numbers of pages in ten weeks: 46, 38, 52, 61, 40, 57, 44, 49, 66, 35. Find the five-number summary.
- A penguin’s thirteen dives lasted 72, 58, 95, 64, 81, 70, 103, 66, 88, 77, 60, 92, 84 seconds. Find the five-number summary.
- Find the median and the quartiles of 2.4, 1.8, 3.5, 2.9, 4.1, 2.2, 3.0, 1.5, 3.8.
- Carys took these numbers of strokes on the 14 holes of a mini golf course: 3, 2, 4, 2, 5, 3, 3, 7, 2, 4, 1, 3, 6, 2. Find the five-number summary.
Part 1: from a display, and by position
Table A shows how many strokes each of 23 players took on the last hole of a course.
| Strokes | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| Players | 1 | 6 | 7 | 5 | 3 | 1 |
- Figure 3 shows how many strokes each of 20 players took on the windmill hole. Find the five-number summary.
- From Table A, with 1, 6, 7, 5, 3, 1 players taking 1 to 6 strokes, find the five-number summary.
- A sorted list has 27 values. Which positions hold the median, Q_1 and Q_3?
- A sorted list has 24 values. Between which positions do the median, Q_1 and Q_3 fall?
Part 2: range and IQR
- Find the range and the IQR of Cai’s ten weeks in Exercise 3.
- A data set has the five-number summary 12, 18, 25, 31, 44. Find its range and its IQR.
- Find the range and the IQR of the thirteen dives in Exercise 4. Between which two times does the middle half of the dives lie?
- Eight dives last 26, 31, 20, 35, 25, 28, 23, 30 seconds. Find the range and the IQR. Then the 35 is replaced by 75; find both again.
- Calixta’s reading log has the five-number summary 30, 42, 48, 53, 90 pages per week, and Camilo’s has 30, 35, 50, 70, 90. Find each range and IQR. Whose ordinary weeks are more alike?
Part 2: working backwards
- A data set has Q_1 = 14, an IQR of 9, a maximum of 40 and a range of 31. Find Q_3 and the minimum.
- The sorted list 10, 13, 15, 18, 22, 25, x, 29, 33 has an IQR of 14. Find x.
- Write seven whole numbers whose five-number summary is 2, 5, 9, 12, 20.
Explain your reasoning
- Explain why the IQR of a data set can never be larger than its range.
- Can a data set have an IQR of 0 and a range that is not 0? Give an example or explain why not.
- A data set has ten values. Explain why making the largest value larger changes the range but not the IQR.
- A data set has 11 different values. How many values lie below Q_1, between Q_1 and the median, between the median and Q_3, and above Q_3? Explain why these four counts do not add up to 11.
- Two data sets have the same median and the same range. Must they have the same IQR? Explain.
Answers
- Q_1 = 11, median 15, Q_3 = 22. Sorted: 9, 11, 13, 15, 18, 22, 25; the median is left out, and the halves 9, 11, 13 and 18, 22, 25 have middles 11 and 22.
- Q_1 = 6, median 9, Q_3 = 13. Sorted: 3, 5, 7, 8, 10, 12, 14, 16; the median is \displaystyle \frac{8 + 10}{2} = 9, and the halves give \displaystyle \frac{5 + 7}{2} = 6 and \displaystyle \frac{12 + 14}{2} = 13.
- 35, 40, 47.5, 57, 66. Sorted: 35, 38, 40, 44, 46, 49, 52, 57, 61, 66; the median is \displaystyle \frac{46 + 49}{2} = 47.5, and the halves of five have middles 40 and 57.
- 58, 65, 77, 90, 103 seconds. Sorted: 58, 60, 64, 66, 70, 72, 77, 81, 84, 88, 92, 95, 103. The seventh value, 77, is left out; the halves of six give \displaystyle Q_1 = \frac{64 + 66}{2} = 65 and \displaystyle Q_3 = \frac{88 + 92}{2} = 90.
- Median 2.9, Q_1 = 2, Q_3 = 3.65. Sorted: 1.5, 1.8, 2.2, 2.4, 2.9, 3.0, 3.5, 3.8, 4.1; with 2.9 left out, \displaystyle \frac{1.8 + 2.2}{2} = 2 and \displaystyle \frac{3.5 + 3.8}{2} = 3.65.
- 1, 2, 3, 4, 7. Sorted: 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 5, 6, 7. The seventh and eighth values are both 3, and the halves of seven have fourth values 2 and 4.
- 2, 3, 4, 5, 9. Running totals: 3, 9, 14, 17, 19, 20. The tenth and eleventh dots are at 4. The lower half, positions 1 to 10, has its fifth and sixth dots at 3; the upper half, positions 11 to 20, has its middle at positions 15 and 16, both at 5.
- 1, 2, 3, 4, 6. Running totals: 1, 7, 14, 19, 22, 23. The median is position 12, a 3. The lower half, positions 1 to 11, has middle position 6, a 2; the upper half, positions 13 to 23, has middle position 18, a 4.
- Median the 14th, Q_1 the 7th, Q_3 the 21st. Position \displaystyle \frac{27 + 1}{2} = 14 is left out, leaving halves of 13, whose middles are the seventh of each: positions 7 and 14 + 7.
- Median between the 12th and 13th, Q_1 between the 6th and 7th, Q_3 between the 18th and 19th. The halves are positions 1 to 12 and 13 to 24.
- Range 31 pages, IQR 17 pages: 66 - 35 = 31 and 57 - 40 = 17.
- Range 44 - 12 = 32, IQR 31 - 18 = 13.
- Range 103 - 58 = 45 seconds, IQR 90 - 65 = 25 seconds. The middle half of the dives lies from 65 to 90 seconds.
- Range 15 and IQR 6.5, then range 55 and IQR 6.5. Sorted: 20, 23, 25, 26, 28, 30, 31, 35, so \displaystyle Q_1 = \frac{23 + 25}{2} = 24 and \displaystyle Q_3 = \frac{30 + 31}{2} = 30.5. The 75 is still the last value, so the quartiles stay, while the range becomes 75 - 20 = 55.
- Calixta: range 60, IQR 11. Camilo: range 60, IQR 35. Calixta’s middle half of weeks spans only 11 pages, so her ordinary weeks are more alike.
- Q_3 = 23 and the minimum is 9: Q_3 = Q_1 + \text{IQR} = 14 + 9, and the minimum is 40 - 31.
- x = 27. The fifth value, 22, is the median and is left out. The lower half gives \displaystyle Q_1 = \frac{13 + 15}{2} = 14, so Q_3 = 28. The upper half is 25, x, 29, 33, so \displaystyle \frac{x + 29}{2} = 28, x + 29 = 56 and x = 27, which lies between 25 and 29.
- One answer: 2, 5, 7, 9, 10, 12, 20. With seven values the median is the fourth, and Q_1 and Q_3 are the second and sixth. So the list is 2, 5, a, 9, b, 12, 20 with a from 5 to 9 and b from 9 to 12.
- Q_1 is the median of values that are all at least the minimum, so it is at least the minimum; likewise Q_3 is at most the maximum. So the stretch from Q_1 to Q_3 lies inside the stretch from the minimum to the maximum and cannot be longer.
- Yes. For 4, 5, 5, 5, 5, 5, 5, 9 the halves are 4, 5, 5, 5 and 5, 5, 5, 9, so Q_1 = 5 and Q_3 = 5, an IQR of 0, while the range is 9 - 4 = 5. The middle of the data is all one value; the IQR says nothing about the ends.
- With ten values Q_1 and Q_3 are positions 3 and 8, and the median uses positions 5 and 6; none uses position 10. A larger largest value stays in position 10 and every other value stays put, so the IQR is unchanged, while the range grows by as much as the maximum did.
- Two in each, 8 in all. The median is position 6; the halves are positions 1 to 5 and 7 to 11, so Q_1 is position 3 and Q_3 position 9. That leaves positions 1, 2, then 4, 5, then 7, 8, then 10, 11. The other three values are Q_1, the median and Q_3 themselves, which are data values because each half of five has a middle value.
- No. The median and range use only the middle and the two ends. For example 1, 5, 6, 7, 11 and 1, 2, 6, 10, 11 both have median 6 and range 10, but their IQRs are 9 - 3 = 6 and 10.5 - 1.5 = 9.