Chapter 10 · Statistics: samples and populations

Mean, Median, Mode, Range, Quartiles and IQR

Find the mean, median, mode and range of a list of data. Then split the ordered list into halves to find the quartiles and the interquartile range.

16 min read

In this lesson, a data set is a list of numbers that all measure the same thing, such as the points a basketball player scores in each game. A long list is hard to take in at once, so you describe it with a few summary numbers.

A measure of center describes a typical value in the data set. A measure of variability describes how spread out the values are.

You will calculate three measures of center and two measures of variability, always working straight from the listed values. The table introduces the first four measures.

Four ways to summarize a data set
MeasureKind of measureWhat it tells youHow to calculate it
Mean
Center
What each value would be if the total were shared out equally
Add all the values, then divide the sum by the number of values
Median
Center
The middle of the data when the values are in order from least to greatest
Order the values. Take the middle value if there is one, or the mean of the two middle values if there are two
Mode
Center
The value that appears most often
Count how many times each value appears and look for the highest count
Range
Variability
How far apart the least and greatest values are
Subtract the least value from the greatest value

You can add the values in any order to find the mean, because adding the same numbers in a different order gives the same sum. The median is different: you can only find the middle after you write the values in order from least to greatest.

To find the middle, cross off one value from each end of the ordered list, again and again, until only one or two values are left.

  • If the number of values is odd, one value is left. That value is the median.
  • If the number of values is even, two values are left. The median is the number halfway between them, which is their mean. For 3,5,8,103, 5, 8, 10 the two middle values are 55 and 88, so the median is (5+8)÷2=13÷2=6.5(5 + 8) \div 2 = 13 \div 2 = 6.5.

Worked example

Mean, median, mode and range

A basketball player's points in 77 games were 6,14,9,6,11,20,46, 14, 9, 6, 11, 20, 4. Find the mean, median, mode and range of the points.

  1. Write the values in order from least to greatest. You find the median by position in the ordered list, and ordering also makes repeated values and the two end values easy to see.

    4, 6, 6, 9, 11, 14, 204,\ 6,\ 6,\ 9,\ 11,\ 14,\ 20
  2. Find the mean. Add all 7 values to get the total, then divide by 7, because the mean shares the total equally among the 7 games.

    4+6+6+9+11+14+207=707=10\dfrac{4+6+6+9+11+14+20}{7} = \dfrac{70}{7} = 10
  3. Find the median. There are 7 values, an odd number, so exactly one value is in the middle: the 4th, with 3 values before it and 3 values after it.

    4, 6, 6⏟3 values9⏟median11, 14, 20⏟3 values\underbrace{4,\ 6,\ 6}_{3\text{ values}} \quad \underbrace{9}_{\text{median}} \quad \underbrace{11,\ 14,\ 20}_{3\text{ values}}
  4. Find the mode. Count how many times each value appears: 6 appears twice and every other value appears once, so 6 appears most often.

    mode=6\text{mode} = 6
  5. Find the range. Subtract the least value, 4, from the greatest value, 20, because the range is the distance between the two ends of the ordered list.

    20−4=1620 - 4 = 16

Answer

The mean is 1010 points, the median is 99 points, the mode is 66 points and the range is 1616 points.

The range uses only the least and greatest values, so it cannot tell you how the values in between are spread. To describe the middle part of the data, you need cut points inside the list.

You already know one cut point. The median cuts the ordered list into two halves. Cut each half again at its own median and you have four parts. These three cut points are the quartiles. The distance between the first and the last of them tells you how spread out the middle part of the data is.

Key concept

Quartiles are medians of the two halves

  • Order. Write the values from least to greatest and find the median.
  • Split. The median splits the list into a lower half and an upper half. If the number of values is odd, the median is one of the listed values. It is the cut point itself, so it goes in neither half. If the number of values is even, the cut falls between the two middle values, so every value goes into a half.
  • Find the quartiles. The first quartile, Q1Q_1, is the median of the lower half. The third quartile, Q3Q_3, is the median of the upper half. The median of the whole list is the second quartile.
  • Subtract. The interquartile range, or IQR, is the distance from Q1Q_1 to Q3Q_3.
IQR=Q3−Q1\text{IQR} = Q_3 - Q_1
Where the halves fall in an ordered list
Number of valuesMedianLower halfUpper halfEach half has
77 (odd)
the 4th value
1st to 3rd values
5th to 7th values
33 values
88 (even)
halfway between the 4th and 5th values
1st to 4th values
5th to 8th values
44 values
99 (odd)
the 5th value
1st to 4th values
6th to 9th values
44 values
1010 (even)
halfway between the 5th and 6th values
1st to 5th values
6th to 10th values
55 values

Worked example

Quartiles and IQR with an odd number of values

The basketball player's points from the first example, in order, are 4,6,6,9,11,14,204, 6, 6, 9, 11, 14, 20. Find the first quartile, the third quartile and the interquartile range.

  1. Split the ordered list at the median. There are 7 values, an odd number, so the median is the 4th value, 9. It is the cut point itself, so it goes in neither half. Each half has 3 values.

    4, 6, 6⏟lower half9⏟median11, 14, 20⏟upper half\underbrace{4,\ 6,\ 6}_{\text{lower half}} \quad \underbrace{9}_{\text{median}} \quad \underbrace{11,\ 14,\ 20}_{\text{upper half}}
  2. Find the first quartile, the median of the lower half. The lower half has 3 values, an odd number, so its median is its middle value, the 2nd one.

    Q1=6Q_1 = 6
  3. Find the third quartile, the median of the upper half. The upper half also has 3 values, so its median is its middle value, 14.

    Q3=14Q_3 = 14
  4. Find the interquartile range. Subtract the first quartile from the third quartile, because the IQR is the distance between them. The third quartile comes from the upper half, so it is never less than the first quartile and the result is never negative.

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

Answer

The first quartile is 66 points, the third quartile is 1414 points and the interquartile range is 88 points.

Worked example

Quartiles and IQR with an even number of values

Eight students timed their trips to school in minutes: 16,4,20,8,27,6,18,1116, 4, 20, 8, 27, 6, 18, 11. Find the median, the first quartile, the third quartile and the interquartile range.

  1. Order the values from least to greatest, because you find the median and the quartiles by position in the ordered list.

    4, 6, 8, 11, 16, 18, 20, 274,\ 6,\ 8,\ 11,\ 16,\ 18,\ 20,\ 27
  2. Find the median. There are 8 values, an even number, so two values share the middle: the 4th and the 5th. The median is their mean, which does not have to be one of the listed values.

    11+162=272=13.5\dfrac{11 + 16}{2} = \dfrac{27}{2} = 13.5
  3. Split the ordered list at the median. The cut falls between 11 and 16, so every value goes into a half: the first 4 values are the lower half and the last 4 values are the upper half.

    4, 6, 8, 11⏟lower half16, 18, 20, 27⏟upper half\underbrace{4,\ 6,\ 8,\ 11}_{\text{lower half}} \quad \underbrace{16,\ 18,\ 20,\ 27}_{\text{upper half}}
  4. Find the first quartile, the median of the lower half. That half has 4 values, an even number, so take the mean of its two middle values, 6 and 8.

    Q1=6+82=142=7Q_1 = \dfrac{6 + 8}{2} = \dfrac{14}{2} = 7
  5. Find the third quartile the same way. The two middle values of the upper half are 18 and 20.

    Q3=18+202=382=19Q_3 = \dfrac{18 + 20}{2} = \dfrac{38}{2} = 19
  6. Subtract the first quartile from the third quartile to get the interquartile range.

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

Answer

The median is 13.513.5 minutes, the first quartile is 77 minutes, the third quartile is 1919 minutes and the interquartile range is 1212 minutes.

A few numbers can summarize a whole data set. The mean, the median and the mode each describe a typical value, and the range and the interquartile range each describe how spread out the values are. Order the values before you look for a median. For quartiles, split the ordered list at the median, leaving the median out of both halves when the number of values is odd. Then Q1Q_1 and Q3Q_3 are the medians of the halves, and IQR=Q3−Q1\text{IQR} = Q_3 - Q_1. Next, you will calculate the mean absolute deviation, another way to measure how spread out a data set is.