Skip to content
Skip to main content

About this free course

Download this course

Share this free course

Prices, location and spread
Prices, location and spread

Start this free course now. Just create an account and sign in. Enrol and complete the course for a free statement of participation or digital badge if available.

3.2 Quartiles and the interquartile range

Finding the quartiles of a batch is very similar to finding the median.

In Subsection 1.2, we represented a batch as a V-shaped formation, with the median at the ‘hinge’ where the two arms of the V meet. The median splits the batch into two equal parts. Similarly, we can put another hinge in each side of the V and get four roughly equal parts, shaped like this: wedge wedge. For a batch of size 15, it looks like Figure 12.

Described image
Figure 12 Median and quartiles

The points at the side hinges, in this case x subscript open bracket 4 close bracket end and x subscript open bracket 12 close bracket end, are the quartiles. There are two quartiles which, as with the extremes, we call the lower quartile and the upper quartile. The lower quartile separates off the bottom quarter, or lowest 25%. The upper quartile separates off the top quarter, or highest 25%. They are denoted uppercase Q sub 1 and uppercase Q sub 3 respectively. (Sometimes they are referred to as the first quartile and the third quartile.)

You might be wondering, if these are uppercase Q sub 1 and uppercase Q sub 3, what happened to uppercase Q sub 2? Well, have a think about that for a moment.

uppercase Q sub 1 separates the bottom quarter of the data (from the top three quarters), and uppercase Q sub 3 separates the bottom three quarters (from the top quarter). So it would make sense to say that uppercase Q sub 2 separates the bottom two quarters (from the top two quarters). But two quarters make a half, so uppercase Q sub 2 would denote the median, and since there is already a separate word for that, it’s not usual to call it the second quartile.

Usually we cannot divide the batch exactly into quarters. Indeed, this is illustrated in Figure 12 where the two central parts of the wedge wedge are larger than the outer ones. As with calculating the median for an even-sized batch, some rule is needed to tell us how many places we need to count along from the smallest value to find the quartiles. However, there are several alternatives that we could adopt and the particular rule described below is somewhat arbitrary. Different authors and different software may use slightly different rules. If your calculator can find quartiles, note that it may use a different rule.

As you might have expected, the rule involves dividing open bracket n+1 close bracket by 4, where n is the batch size (as opposed to dividing by 2 to find the median). However, the rule is slightly more complicated for the quartiles and it depends on whether n+1 is exactly divisible by 4.

The quartiles

The lower quartile uppercase Q sub 1 is at position fraction open bracket n +1 close bracket over 4 end in the ordered batch.

The upper quartile uppercase Q sub 3 is at position fraction 3 open bracket n +1 close bracket over 4 end in the ordered batch.

If open bracket n+1 close bracket is exactly divisible by 4, these positions correspond to a single value in the batch.

If open bracket n+1 close bracket is not exactly divisible by 4, then the positions are to be interpreted as follows.

  • A position which is a whole number followed by fraction 1 over 2 end means ‘halfway between the two positions either side’ (as was the case for finding the median).

  • A position which is a whole number followed by fraction 1 over 4 end means ‘one quarter of the way from the position below to the position above’. So for instance if a position is 5 fraction 1 over 4 end, the quartile is the number one quarter of the way from x subscript open bracket 5 close bracket end to x subscript open bracket 6 close bracket end.

  • A position which is a whole number followed by fraction 3 over 4 end means ‘three quarters of the way from the position below to the position above’. So for instance if a position is 4 fraction 3 over 4 end, the quartile is the number three quarters of the way from x subscript open bracket 4 close bracket end to x subscript open bracket 5 close bracket end.

Before we actually use these rules to find quartiles, let us look at some more examples of wedge wedge-shaped diagrams for different batch sizes n. The case where open bracket n+1 close bracket is exactly divisible by 4, so that fraction 1 over 4 end open bracket n+1 close bracket is a whole number, was shown in Figure 12. The following three figures show the three other possible scenarios, where open bracket n+1 close bracket is not exactly divisible by 4.

For n = 17, fraction 1 over 4 end open bracket n+1 close bracket = 4 fraction 1 over 2 end and fraction 3 over 4 end open bracket n+1 close bracket = 13 fraction 1 over 2 end. So uppercase Q sub 1 is halfway between x subscript open bracket 4 close bracket end and x subscript open bracket 5 close bracket end, and uppercase Q sub 3 is halfway between x subscript open bracket 13 close bracket end and x subscript open bracket 14 close bracket end.

Described image
Figure 13 Quartiles for sample size n=17

For n = 18, fraction 1 over 4 end open bracket n+1 close bracket = 4 fraction 3 over 4 end and fraction 3 over 4 end open bracket n+1 close bracket = 14 fraction 1 over 4 end. So uppercase Q sub 1 is three quarters of the way from x subscript open bracket 4 close bracket end to x subscript open bracket 5 close bracket end, and uppercase Q sub 3 is one quarter of the way from x subscript open bracket 14 close bracket end to x subscript open bracket 15 close bracket end.

Described image
Figure 14 Quartiles for sample size n=18

For n = 20, fraction 1 over 4 end open bracket n+1 close bracket = 5 fraction 1 over 4 end and fraction 3 over 4 end open bracket n+1 close bracket = 15 fraction 3 over 4 end. So uppercase Q sub 1 is one quarter of the way from x subscript open bracket 5 close bracket end to x subscript open bracket 6 close bracket end, and uppercase Q sub 3 is three quarters of the way from x subscript open bracket 15 close bracket end to x subscript open bracket 16 close bracket end.

Described image
Figure 15 Quartiles for sample size n=20

Example 14 Quartiles for the prices of small televisions

Figure 15 showed you where the quartiles are for a batch of size 20. Let us now use the stemplot of the 20 television prices in Figure 16, which you first met in Figure 5 (Subsection 1.2), to find the lower and upper quartiles, uppercase Q sub 1 and uppercase Q sub 3, of this batch.

Described image
Figure 16 Prices of flat-screen televisions with a screen size of 24 inches or less

To calculate the lower quartile uppercase Q sub 1 you need to find the number that is one quarter of the way from x subscript open bracket 5 close bracket end to x subscript open bracket 6 close bracket end. These values are both 130, so uppercase Q sub 1 is 130. To calculate the upper quartile uppercase Q sub 3 you need to find the number three quarters of the way from x subscript open bracket 15 close bracket end to x subscript open bracket 16 close bracket end. These values are both 180, so uppercase Q sub 3 is 180.

That example was easier than it might have been, because for each quartile the two numbers we had to consider turned out to be equal!

Example 15 Quartiles for the camera prices

Table 2 (Subsection 1.2) gave ten prices for a particular model of digital camera (in pounds). In order, the prices are as follows.

53 60 65 70 70 74 79 81 85 90

To find the lower and upper quartiles, uppercase Q sub 1 and uppercase Q sub 3, of this batch, first find fraction 1 over 4 end open bracket n+1 close bracket = 2 fraction 3 over 4 end and fraction 3 over 4 end open bracket n+1 close bracket = 8 fraction 1 over 4 end.

The lower quartile uppercase Q sub 1 is the number three quarters of the way from x subscript open bracket 2 close bracket end to x subscript open bracket 3 close bracket end. These values are 60 and 65. The difference between them is 65 minus 60=5, and three quarters of that difference is fraction 3 over 4 end times 5 = 3.75. Therefore uppercase Q sub 1 is 3.75 larger than 60, so it is 63.75. As with the median, in this course we will generally round the quartiles to the accuracy of the original data, so in this case we round to the nearest whole number, 64. In symbols, uppercase Q sub 1 = 60 + fraction 3 over 4 end open bracket 65 minus 60 close bracket = 63.75 simeq 64.

The upper quartile uppercase Q sub 3 is the number one quarter of the way from x subscript open bracket 8 close bracket end to x subscript open bracket 9 close bracket end. These values are 81 and 85. The difference between them is 85 minus 81=4, and one quarter of that difference is fraction 1 over 4 end times 4 = 1. Therefore uppercase Q sub 3 is 1 larger than 81, so it is 82. (No rounding necessary this time.) In symbols, uppercase Q sub 3 = 81 + fraction 1 over 4 end open bracket 85 minus 81 close bracket = 82.

Example 15 is the subject of the following screencast. [Note that references to ‘the unit’ should be interpreted as ‘this course’. The original wording refers to the Open University course from which this material is adapted.]

Download this video clip.Video player: Calculating quartiles
Copy this transcript to the clipboard
Print this transcript
Show transcript|Hide transcript
Screencast 3 Calculating quartiles
Interactive feature not available in single page view (see it in standard view).

Activity 10 Finding more quartiles

(a) Find the lower and upper quartiles of the batch of 15 coffee prices in Figure 17. (This batch of coffee prices was first introduced in Table 1 of Subsection 1.1.)

Described image
Figure 17 Stemplot of 15 coffee prices

Discussion

Here, because n=15, an appropriate picture of the data would be Figure 12 (Subsection 3.2). To find the lower and upper quartiles, uppercase Q sub 1 and uppercase Q sub 3, of this batch, first find fraction 1 over 4 end open bracket n+1 close bracket = 4 and fraction 3 over 4 end open bracket n+1 close bracket = 12. Therefore uppercase Q sub 1 =268 p and uppercase Q sub 3 =299 p.

(b) Find the lower and upper quartiles of the batch of 14 gas prices in Figure 18. (This batch of gas prices was first introduced in Table 3 of Subsection 1.2.)

Described image
Figure 18 Stemplot of 14 gas prices

Discussion

For this batch, n=14 so fraction 1 over 4 end open bracket n+1 close bracket = 3 fraction 3 over 4 end and fraction 3 over 4 end open bracket n+1 close bracket = 11 fraction 1 over 4 end.

uppercase Q sub 1 = 3.743 + fraction 3 over 4 end open bracket 3.760 minus 3.743 close bracket = 3.75575 simeq 3.756

and

uppercase Q sub 3 = 3.801 + fraction 1 over 4 end open bracket 3.804 minus 3.801 close bracket = 3.80175 simeq 3.802.

So the lower quartile is 3.756 p per kWh and the upper quartile is 3.802p per kWh.