topic badge

4.045 Interquartile range

Lesson

Measures of spread in a numerical data set seek to describe whether the scores in a data set are very similar and clustered together, or whether there is a lot of variation in the scores and they are very spread out.

There are several methods to describe the spread of data, which vary in complexity. We can simply look at the numerical range of the entire data set–the difference between the largest and smallest value, or we can break the data into chunks (such as quartiles, deciles, or percentiles) to examine the range of smaller sections within the data. We can also compare the spread of data to the mean.

In this section, we will look at interquartile range as measure of spread. 

Interquartile range

Whilst the range is very simple to calculate, it is based on only two numbers in the data set, it does not tell us about the spread of data within these two values. To get a better picture of the internal spread in a data set, it is often more useful to find the set's quartiles, from which the interquartile range (IQR) can be calculated.

Quartiles are scores at particular locations in the data set–similar to the median, but instead of dividing a data set into halves, they divide a data set into quarters. Let's look at how we would divide up some data sets into quarters now.

Careful!

Make sure the data set is ordered before finding the quartiles or the median.

 

Exploration

  • Here is a data set with $8$8 scores:
$\editable{1}$1   $\editable{3}$3   $\editable{4}$4   $\editable{7}$7   $\editable{11}$11   $\editable{12}$12   $\editable{14}$14   $\editable{19}$19

 

First locate the median, between the $4$4th and $5$5th scores:

        Median        
              $\downarrow$              
$\editable{1}$1   $\editable{3}$3   $\editable{4}$4   $\editable{7}$7   $\editable{11}$11   $\editable{12}$12   $\editable{14}$14   $\editable{19}$19

 

Now there are four scores in each half of the data set, so split each of the four scores in half to find the quartiles. We can see the first quartile, $Q_1$Q1, is between the $2$2nd and $3$3rd scores–that is, there are two scores on either side of $Q_1$Q1. Similarly, the third quartile, $Q_3$Q3, is between the $6$6th and $7$7th scores:

    $Q_1$Q1   Median   $Q_3$Q3    
      $\downarrow$       $\downarrow$       $\downarrow$      
$\editable{1}$1   $\editable{3}$3   $\editable{4}$4   $\editable{7}$7   $\editable{11}$11   $\editable{12}$12   $\editable{14}$14   $\editable{19}$19

 

  • Now let's look at a situation with $9$9 scores:
    $Q_1$Q1   Median   $Q_3$Q3    
      $\downarrow$         $\downarrow$         $\downarrow$      
$\editable{8}$8   $\editable{8}$8   $\editable{10}$10   $\editable{11}$11   $\editable{13}$13   $\editable{14}$14   $\editable{18}$18   $\editable{22}$22   $\editable{25}$25

 

This time, the $5$5th term is the median. There are four terms on either side of the median, like for the set with eight scores. So $Q_1$Q1 is still between the $2$2nd and $3$3rd scores and $Q_3$Q3 is between the $6$6th and $7$7th scores.

 

  • Finally, let's look at a set with $10$10 scores:
    $Q_1$Q1   Median   $Q_3$Q3    
        $\downarrow$         $\downarrow$         $\downarrow$        
$\editable{12}$12   $\editable{13}$13   $\editable{14}$14   $\editable{19}$19   $\editable{19}$19   $\editable{21}$21   $\editable{22}$22   $\editable{22}$22   $\editable{28}$28   $\editable{30}$30

 

For this set, the median is between the $5$5th and $6$6th scores. This time, however, there are $5$5 scores on either side of the median. So $Q_1$Q1 is the $3$3rd term and $Q_3$Q3 is the $8$8th term.

 

What do the quartiles represent?

Each quartile represents $25%$25% of the data set. The lowest score to the first quartile is approximately $25%$25% of the data, the first quartile to the median is another $25%$25%, the median to the third quartile is another $25%$25%, and the third quartile to the highest score represents the last $25%$25% of the data. We can combine these sections together–for example, $50%$50% of the scores in a data set lie between the first and third quartiles.

These quartiles are sometimes referred to as percentilesA percentile is a percentage that indicates the value below which a given percentage of observations in a group of observations fall. For example, if a score is in the $75$75th percentile in a statistical test, it is higher than $75%$75% of all other scores. The median represents the $50$50th percentile, or the halfway point in a data set.

 

Naming the quartiles

  • $Q_1$Q1 is the first quartile (sometimes called the lower quartile). It is the middle score in the bottom half of data and it represents the $25$25th percentile.
  • $Q_2$Q2 is the second quartile, and is usually called the median, which we have already learnt about. It represents the $50$50th percentile of the data set.
  • $Q_3$Q3 is the third quartile (sometimes called the upper quartile). It is the middle score in the top half of the data set, and represents the $75$75th percentile.

 

Calculating the interquartile range

The interquartile range (IQR) is the difference between the third quartile and the first quartile. $50%$50% of scores lie within the IQR because it contains the data set between the first quartile and the median, as well as the median and the third quartile.

Since it focuses on the middle $50%$50% of the data set, the interquartile range often gives a better indication of the internal spread than the range does, and it is less affected by individual scores that are unusually high or low, which are the outliers.

 

To calculate the interquartile range

Subtract the first quartile from the third quartile. That is,

$\text{IQR }=Q_3-Q_1$IQR =Q3Q1

 

Worked example

Example 1

Consider the following set of data: $1,1,3,5,7,9,9,10,15$1,1,3,5,7,9,9,10,15.

(a) Identify the median.

Think: There are nine numbers in the set, so we can say that $n=9$n=9. We can also see that the data set is already arranged in ascending order. We identify the median as the middle score either by the "cross-out" method or as the $\frac{n+1}{2}$n+12th score. 

Do:

$\text{Position of median}$Position of median $=$= $\frac{9+1}{2}$9+12

Substituting $n=9$n=9 into $\frac{n+1}{2}$n+12

  $=$= $5$5th score

Simplifying the fraction

 

Counting through the set to the $5$5th score gives us $7$7 as the median.

(b) Identify $Q_1$Q1 (the lower quartile) and $Q_3$Q3 (the upper quartile).

Think: We identify $Q_1$Q1 and $Q_3$Q3 as the middle scores in the lower and upper halves of the data set respectively, either by the "cross-out" method–or any method that we use to find the median, but just applying it to the lower or upper half of the data set. 

Do: The lower half of the data set is all the scores to the left of the median, which is $1,1,3,5$1,1,3,5. There are four scores here, so $n=4$n=4. So we can find the position of $Q_1$Q1 as follows:

$\text{Position of }Q_1$Position of Q1 $=$= $\frac{4+1}{2}$4+12

Substituting $n=4$n=4 into $\frac{n+1}{2}$n+12

  $=$= $2.5$2.5th score

Simplifying the fraction

 

$Q_1$Q1 is therefore the mean of the $2$2nd and $3$3rd scores. So we see that:

$Q_1$Q1 $=$= $\frac{1+3}{2}$1+32

Taking the average of the $2$2nd and $3$3rd scores

  $=$= $2$2

Simplifying the fraction

 

The upper half of the data set is all the scores to the right of the median, which is $9,9,10,15$9,9,10,15. Since there are also $n=4$n=4 scores, $Q_3$Q3 will be the mean of the $2$2nd and $3$3rd scores in this upper half.

$Q_3$Q3 $=$= $\frac{9+10}{2}$9+102

Taking the average of the $2$2nd and $3$3rd scores in the upper half

  $=$= $9.5$9.5

Simplifying the fraction

 

(c) Calculate the $\text{IQR }$IQR  of the data set.

Think: Remember that $\text{IQR }=Q_3-Q_1$IQR =Q3Q1, and we just found $Q_1$Q1 and $Q_3$Q3.

Do:

$\text{IQR }$IQR $=$= $9.5-2$9.52

Substituting $Q_1=9.5$Q1=9.5 and $Q_3=2$Q3=2 into the formula

  $=$= $7.5$7.5

Simplifying the subtraction


Practice questions

Question 1

Answer the following, given this set of scores:

$33,38,50,12,33,48,41$33,38,50,12,33,48,41

  1. Sort the scores in ascending order.

  2. Find the number of scores.

  3. Find the median.

  4. Find the first quartile of the set of scores.

  5. Find the third quartile of the set of scores.

  6. Find the interquartile range.

Question 2

The stem plot shows the number of hours students spent studying during an entire semester.

Stem Leaf
$6$6 $2$2 $7$7        
$7$7 $1$1 $2$2 $2$2 $4$4 $7$7 $9$9
$8$8 $0$0 $1$1 $2$2 $5$5 $7$7  
$9$9 $0$0 $1$1        
 
Key: $5$5$\mid$$2$2$=$=$52$52
  1. Find the first quartile of the set of scores.

  2. Find the third quartile of the set of scores.

  3. Find the interquartile range.

Question 3

The column graph shows the number of pets that each student in a class owns.

PetsFrequency510012345

  1. Find the first quartile of the set of scores.

  2. Find the third quartile of the set of scores.

  3. Find the interquartile range.

Outcomes

3.3.1.8

calculate and interpret statistical measures of spread, such as the range, interquartile range and standard deviation [complex]

What is Mathspace

About Mathspace