## 3. Interquartile range

The range of observations within a dataset is the simplest measure of variability. Look at another dataset:

Set 5 | 2 | 3 | 5 | 6 | 6 | 7 | 9 | 9 | 13 | 28 | 50 |

These are discrete scale data. There are eleven observations, and the range is given by:

range = x_{max} - x_{min} = 50 – 2 = 48

Notice that the nine lowest values are all under ten, and that the range is 'inflated' by the three very high values. This can be seen by comparing the median value of 7 with the mean value of 12.55. Extreme values, often called '**outliers**', will make the range larger, and if there is only a few of them they cause an exaggerated view of the variability. Note that outliers could be atypically large, atypically small or both.

You have already seen the use of the median value – simply the middle value of an ordered data series. Calculation of the interquartile range takes this principle further by finding the 'medians' of the value groups either side of the median. So for Set 5:

Set 5 | 2 | 3 | 5 | 6 | 6 | 7 | 9 | 9 | 13 | 28 | 50 |

The median of this set of observations is the middle value, observation 6. The **lower quartile** is the midpoint of the group below the median, in this case observation 3. The **upper quartile** is the midpoint of the group above the median, here observation 9.

The interquartile range is calculated simply by subtracting the value of the lower quartile from the value of the upper quartile:

interquartile range = upper quartile value – lower quartile value

In this case, the interquartile range is 13 – 5 = 8. Even if the highest value had been 500, or the lowest value -500, the interquartile range would have been the same if the other values had remained as shown. As with the range, the value of the interquartile range is always a positive number.

Interquartile range can be used with scale or ordinal data, but not with nominal data. It is an appropriate measure of variability to use when the median is used to describe the population average, especially where the distribution of observation values is skewed as in this example.