Chapter 13 · Statistics and data displays

Quartiles and the Interquartile Range

Split ordered data into halves and find the three quartiles. Then subtract to get the interquartile range, which shows how spread out the middle of the data is.

12 min read

You already know how to find the range of a data set. The range uses only two values: the least and the greatest. So one unusual value can stretch it a lot.

Eight students wrote down how many minutes they read last night:

20,21,23,24,26,27,29,6020, 21, 23, 24, 26, 27, 29, 60

The range is 60−20=4060 - 20 = 40 minutes. But seven of the eight students read between 2020 and 2929 minutes. The range makes these reading times look far more spread out than most of them are.

In this lesson, you will measure how spread out the middle of the data is.

Quartiles are three values that divide an ordered data set into four sections. You build them from medians, so start there.

The median is the middle value of a data set when the values are in order from least to greatest. When the count of values is odd, one value sits in the middle, and that value is the median. When the count is even, two values share the middle. Then the median is the number halfway between them: add the two and divide by 22.

The median separates the ordered list into a lower half and an upper half. This course uses one rule for the halves every time:

  • Even count: the lower half is the first half of the ordered list, and the upper half is the second half. Every value is in one half.
  • Odd count: leave the median out of both halves. The lower half is every value listed before the median. The upper half is every value listed after it.

Other books or calculators may split an odd-sized list in a different way, so their quartiles can differ. In this course, you always leave the median out of both halves.

The table shows this rule at work on two lists. Each row is one ordered list. The Count column tells how many data values that list has. The other columns show the list's lower half, its median, and its upper half.

The second list is the first list with one more value, 2020. Watch what happens to 1010. In the first list, it belongs to the upper half. In the second list, it is the median, so you leave it out of both halves.

Splitting an ordered list into halves
Ordered listCountLower halfMedianUpper half
3,5,6,8,10,11,13,163, 5, 6, 8, 10, 11, 13, 16
88 (even)
3,5,6,83, 5, 6, 8
8+102=182=9\frac{8 + 10}{2} = \frac{18}{2} = 9
10,11,13,1610, 11, 13, 16
3,5,6,8,10,11,13,16,203, 5, 6, 8, 10, 11, 13, 16, 20
99 (odd)
3,5,6,83, 5, 6, 8
1010, left out of both halves
11,13,16,2011, 13, 16, 20

Here is the idea behind the next step. Find the median of the lower half and the median of the upper half. Those two values mark the edges of the middle part of the data, which is roughly the middle half of the values. It is roughly half, not always exactly half, because short lists and lists with repeated values do not always split evenly.

The distance between those two values tells you how spread out the middle of the data is. A small distance means the middle values are packed close together. A large distance means they are spread out.

Key concept

Quartiles and the interquartile range

Order the data from least to greatest. The quartiles are three medians:

  • Q2Q_2, the second quartile, is the median of the whole data set.
  • Q1Q_1, the first quartile, is the median of the lower half.
  • Q3Q_3, the third quartile, is the median of the upper half.

When the count of values is even, every value is in one half. When the count is odd, leave the median out of both halves.

The interquartile range (IQR) is the distance from Q1Q_1 to Q3Q_3. You find it by subtracting, so it has the same unit as the data. It is not a count of data values.

IQR=Q3−Q1\text{IQR} = Q_3 - Q_1

Worked example

An even count: reading times

Eight students read for 20,21,23,24,26,27,29,6020, 21, 23, 24, 26, 27, 29, 60 minutes last night. Find the quartiles and the interquartile range.

  1. Check the order first, because quartiles depend on each value's position in the ordered list. This list already goes from least to greatest. Count the values: there are eight, which is an even count.

    20, 21, 23, 24, 26, 27, 29, 6020,\ 21,\ 23,\ 24,\ 26,\ 27,\ 29,\ 60
  2. Find the median, which is the second quartile. With eight values, two values share the middle: the 4th and the 5th, with three values on each side of the pair. They are 24 and 26, so add them and divide by 2. The result is halfway between them: 1 above 24 and 1 below 26.

    Q2=24+262=502=25Q_2 = \frac{24 + 26}{2} = \frac{50}{2} = 25
  3. Split the list into halves. The count is even, so the lower half is the first four values and the upper half is the last four values. Every value is in one half.

    20, 21, 23, 24⏟lower half26, 27, 29, 60⏟upper half\underbrace{20,\ 21,\ 23,\ 24}_{\text{lower half}} \quad \underbrace{26,\ 27,\ 29,\ 60}_{\text{upper half}}
  4. Find the first quartile, the median of the lower half. That half has four values, so two values share its middle: the 2nd and the 3rd. They are 21 and 23, so add them and divide by 2.

    Q1=21+232=442=22Q_1 = \frac{21 + 23}{2} = \frac{44}{2} = 22
  5. Find the third quartile, the median of the upper half, in the same way. The two middle values of that half are 27 and 29.

    Q3=27+292=562=28Q_3 = \frac{27 + 29}{2} = \frac{56}{2} = 28
  6. Subtract the first quartile from the third quartile. The difference is the distance between them, and that distance is the interquartile range.

    IQR=Q3−Q1=28−22=6\text{IQR} = Q_3 - Q_1 = 28 - 22 = 6

Answer

The quartiles are Q1=22Q_1 = 22, Q2=25Q_2 = 25 and Q3=28Q_3 = 28 minutes. The interquartile range is 66 minutes.

Now compare the two measures for the reading times. The range is 4040 minutes, but the IQR is only 66 minutes.

The unusual value 6060 stretched the range. It did not stretch the IQR here. In the upper half 26,27,29,6026, 27, 29, 60, the two middle values are 2727 and 2929, and 6060 is not one of them.

Suppose that student had read 3030 minutes instead of 6060. The range would drop to 30−20=1030 - 20 = 10 minutes. But Q3Q_3 would still be 2828, and the IQR would still be 66 minutes.

Worked example

An odd count: plant heights

Seven bean plants are 12,7,17,9,21,11,1412, 7, 17, 9, 21, 11, 14 centimeters tall. Find the quartiles and the interquartile range.

  1. Put the heights in order from least to greatest. Then count them: there are seven values, which is an odd count.

    7, 9, 11, 12, 14, 17, 217,\ 9,\ 11,\ 12,\ 14,\ 17,\ 21
  2. Find the median, which is the second quartile. With seven values, the 4th value sits in the middle, with three values on each side.

    Q2=12Q_2 = 12
  3. Split the list into halves. The count is odd, so leave the median, 12, out of both halves. The lower half is the three values listed before it. The upper half is the three values listed after it.

    7, 9, 11⏟lower half1214, 17, 21⏟upper half\underbrace{7,\ 9,\ 11}_{\text{lower half}} \quad 12 \quad \underbrace{14,\ 17,\ 21}_{\text{upper half}}
  4. Find the median of each half. Each half has three values, so its 2nd value sits in the middle. That is 9 in the lower half and 17 in the upper half.

    Q1=9,Q3=17Q_1 = 9, \quad Q_3 = 17
  5. The interquartile range is the distance between the quartiles, so subtract the first quartile from the third quartile.

    IQR=Q3−Q1=17−9=8\text{IQR} = Q_3 - Q_1 = 17 - 9 = 8

Answer

The quartiles are Q1=9Q_1 = 9, Q2=12Q_2 = 12 and Q3=17Q_3 = 17 centimeters. The interquartile range is 88 centimeters.

Worked example

An odd count with repeated values

Nine players scored 8,13,4,8,15,3,11,8,78, 13, 4, 8, 15, 3, 11, 8, 7 points in a game. Find the quartiles and the interquartile range.

  1. Order the scores from least to greatest. Write 8 three times, because three players scored 8. Then count: there are nine values, which is an odd count.

    3, 4, 7, 8, 8, 8, 11, 13, 153,\ 4,\ 7,\ 8,\ 8,\ 8,\ 11,\ 13,\ 15
  2. Find the median, which is the second quartile. With nine values, the 5th value sits in the middle, with four values on each side.

    Q2=8Q_2 = 8
  3. Split the list. The count is odd, so leave the median out of both halves. That removes only the one 8 in the 5th position. The 8 in the 4th position stays in the lower half, and the 8 in the 6th position stays in the upper half.

    3, 4, 7, 8⏟lower half88, 11, 13, 15⏟upper half\underbrace{3,\ 4,\ 7,\ 8}_{\text{lower half}} \quad 8 \quad \underbrace{8,\ 11,\ 13,\ 15}_{\text{upper half}}
  4. Find the first quartile. The lower half has four values, so two values share its middle: the 2nd and the 3rd, which are 4 and 7. Add them and divide by 2.

    Q1=4+72=112=5.5Q_1 = \frac{4 + 7}{2} = \frac{11}{2} = 5.5
  5. Find the third quartile from the 2nd and 3rd values of the upper half, which are 11 and 13.

    Q3=11+132=242=12Q_3 = \frac{11 + 13}{2} = \frac{24}{2} = 12
  6. Subtract the first quartile from the third quartile, because the interquartile range is the distance between them.

    IQR=Q3−Q1=12−5.5=6.5\text{IQR} = Q_3 - Q_1 = 12 - 5.5 = 6.5

Answer

The quartiles are Q1=5.5Q_1 = 5.5, Q2=8Q_2 = 8 and Q3=12Q_3 = 12 points. The interquartile range is 6.56.5 points.

Quartiles come from medians. Order the data, find the median, and then find the median of each half. When the count is odd, leave the median out of both halves. The interquartile range is Q3−Q1Q_3 - Q_1. It is a distance in the data's own unit, not a count, and it tells you how wide the middle part of the data is.

Next, you will learn to find the mean absolute deviation, another way to describe how spread out data is.