Chapter 14 Β· Statistics and data analysis
Quartiles and Interquartile Range
Learn to find the first and third quartiles as the medians of the lower and upper halves of ordered data, then subtract them to get the interquartile range.
You already know the median: the middle of a data set once its values are in order from least to greatest. The median does a second job too. It cuts the ordered data into a lower half (the values at the low end of the list) and an upper half (the values at the high end).
In this lesson you ask the same question about each half: where is its middle? The two answers are called quartiles. One marks the middle of the lower half, and the other marks the middle of the upper half.
The distance between those two quartiles is the interquartile range. It tells you how spread out the middle part of the data is. When that distance is small, the values in the middle of the ordered list are close together.
Before you can find a quartile, you need a clear rule for which values go in each half.
There is more than one accepted way to find quartiles, so this lesson uses one agreed method every time. It is called the median-of-halves convention.
Put the data in order from least to greatest. Then form the halves using the count, which is the number of values in the data set:
- Even count: the middle of the list falls between two values, so no value is left out. The lower half is the first half of the list, and the upper half is the second half.
- Odd count: the middle of the list is a data value, the overall median. It is the dividing point between the halves, so leave it out of both. The lower half is every value before it, and the upper half is every value after it.
Either way, the two halves have the same number of values.
Now you can name the quartiles. Use ordered data and the halves from the median-of-halves convention, with the overall median left out of both halves when the count is odd:
- The first quartile, written , is the median of the lower half.
- The third quartile, written , is the median of the upper half.
- The interquartile range, written IQR, is the distance from up to , so .
The overall median is the second quartile, which is why the other two are numbered first and third.
The table works through two small data sets, one with an even count and one with an odd count.
| What you find | Even count: 10, 13, 15, 18, 21, 22 | Odd count: 10, 13, 15, 18, 21, 22, 26 |
|---|---|---|
Count of values | ||
Overall median | , between the 3rd and 4th values | , the 4th value |
Left out of the halves | No value | The median, |
Lower half | ||
Upper half | ||
, the median of the lower half | ||
, the median of the upper half | ||
Key concept
The median-of-halves convention for quartiles
In the median-of-halves convention, the first and third quartiles are the medians of the two halves of an ordered data set. The data set needs at least two numbers, so that each half has at least one value.
- Order the data from least to greatest. Keep every repeated value.
- Split the ordered list into a lower half and an upper half. If the count is odd, leave the overall median out of both halves. If the count is even, leave no value out.
- Find the median of each half. is the median of the lower half, and is the median of the upper half.
- Subtract from to get the interquartile range (IQR).
, and the IQR all have the same unit as the data.
Worked example
Example 1: An even count
The data, already in order from least to greatest, are . Use the median-of-halves convention to find , and the IQR.
Check the order and count the values. The list goes from least to greatest and has 8 values. Because 8 is even, the middle of the list falls between the 4th and 5th values, 19 and 21. The overall median is their mean, and no value is left out of the halves.
Split the ordered list at that middle point. The lower half is the first 4 values and the upper half is the last 4 values, so both halves have the same number of values.
Find the first quartile, which is the median of the lower half. That half has 4 values, an even count, so its median is the mean of its two middle values, 15 and 16. The result is exact, not rounded, and it does not have to be one of the data values.
Find the third quartile, which is the median of the upper half, in the same way. That half also has 4 values, and its two middle values are 24 and 27.
Find the interquartile range. It is the distance from the first quartile up to the third quartile, so subtract the first quartile from the third quartile.
Answer
For the data , the median-of-halves convention gives , and an interquartile range of .
Worked example
Example 2: An odd count
The data, already in order from least to greatest, are . Use the median-of-halves convention to find , and the IQR.
Check the order and count the values. The list goes from least to greatest and has 9 values. Because 9 is odd, the middle of the list is a data value: the 5th one, with 4 values before it and 4 values after it. That value, 22, is the overall median.
Form the halves. In the median-of-halves convention, the median of an odd count is the dividing point between the halves, so leave the 22 out of both. The lower half is the 4 values before it, and the upper half is the 4 values after it.
Find the first quartile, the median of the lower half. That half has 4 values, so its median is the mean of its two middle values, 12 and 15.
Find the third quartile, the median of the upper half. That half also has 4 values, so take the mean of its two middle values, 26 and 29.
Subtract the first quartile from the third quartile to get the interquartile range, the distance between them.
Answer
For the data , the median-of-halves convention gives , and an interquartile range of .
Worked example
Example 3: Unordered data with repeated values
Eleven students timed how long a puzzle took them. Their times, in minutes, were . Use the median-of-halves convention to find , and the IQR of these times.
Order the times from least to greatest, because the median and the halves depend on position in the ordered list. Ordering rearranges the values without changing them, so keep both 15s, both 17s and both 21s.
Count the values and find the overall median. There are 11 values, an odd count, so the median is the 6th value, with 5 values before it and 5 values after it.
Form the halves. Because the count is odd, the median-of-halves convention leaves the overall median out of both halves, but only the one value in the 6th position. The other 21 is a separate data value in the 7th position, so it stays in the upper half.
Find the median of each half. Each half has 5 values, an odd count, so its median is its 3rd value, with 2 values before it and 2 values after it. That is 17 in the lower half and 26 in the upper half.
Subtract the first quartile from the third quartile. The times are in minutes, so the interquartile range is in minutes too.
Answer
Under the median-of-halves convention, the eleven puzzle times have minutes, minutes and an interquartile range of minutes.
Takeaway. The first and third quartiles are medians of halves. Under the median-of-halves convention, you put the data in order, split it into a lower half and an upper half (leaving the overall median out of both when the count is odd), and take the median of each half to get and . Then tells you how spread out the middle part of the data is, in the same unit as the data.
Next, you will create and interpret box plots.