Median, Quartiles and Interquartile Range
The median is the middle value when the data are put in order, and the quartiles cut the data into quarters. Together they describe a data set in a way that ignores a few extreme values: the median is the typical value, and the interquartile range measures how spread out the middle half is. The syllabus lists median, range and interquartile range among the measures you must "understand and use", and they appear in nearly every Paper 5 data question: from raw lists, stem-and-leaf diagrams, frequency tables and cumulative frequency graphs.
The median
The median is the middle value of the data when arranged in order of size. For ordered values it is the th value. When is even this position is a half, and the median is the mean of the two middle values.
- : the th value.
- : halfway between the th and th values.
The position formula gives where the median is, not what it is. A common slip is to write "median " when was the position.
Quartiles
The median splits the data into a lower half and an upper half. The quartiles are the medians of those halves.
- The lower quartile is the median of the lower half of the ordered data.
- The upper quartile is the median of the upper half.
- When is odd, the median itself belongs to neither half.
- The interquartile range is .
- The range is the largest value minus the smallest value.
| Median | Lower half | |||
|---|---|---|---|---|
| th | values – | rd | th | |
| mean of th, th | values – | mean of rd, th | mean of th, th | |
| th | values – | th | th | |
| mean of th, th | values – | mean of th, th | mean of th, th | |
| mean of th, th | values – | mean of th, th | mean of th, th |
Textbooks differ slightly on quartiles for small data sets (some use the th value with interpolation). The halves method above is clear and widely accepted for Paper 5; whatever method you use, state the positions so the examiner can follow you. For large grouped data sets the question will expect a cumulative frequency graph, where these small differences vanish.
Why the IQR and not just the range
The range depends on only two values, the two most extreme, so a single unusual value can make it enormous. The IQR describes the spread of the middle of the data, so it ignores the top and bottom quarters, where outliers live. The IQR goes naturally with the median; the standard deviation goes naturally with the mean.
Percentiles
The th percentile is the value below which of the data lie. The lower quartile is the th percentile, the median the th and the upper quartile the th. Percentiles are almost always estimated from a cumulative frequency graph, at cumulative frequency . The interval between the th and th percentiles (the to interpercentile range) contains the middle of the data.
The median of a frequency table
When discrete data are given in a frequency table, you cannot see the ordered list, but you can find any position using cumulative frequencies.
- Add a running total (cumulative frequency) column.
- Work out the position(s) needed: for the median; the middle of each half for the quartiles.
- The value at a position is the first value whose cumulative frequency reaches that position.
The median of grouped data
For grouped data, the median is estimated from a cumulative frequency graph at , or calculated by linear interpolation:
where is the lower boundary of the class containing the median, the cumulative frequency before that class, its frequency and its width. Full method and examples are in Cumulative frequency graphs.
Properties of the median
- It is not affected by extreme values: making the largest value ten times larger leaves the median unchanged.
- It is a good average for skewed data or data with outliers.
- It does not use the actual size of every value, only their order, so it uses less information than the mean.
- Two medians cannot be combined to give the median of the combined data (unlike means, which combine through totals).
Worked examples
Find the median, quartiles and interquartile range of:
Solution
Ordered: . .
Median: halfway between the th and th values, .
Lower half: , so . Upper half: , so .
. (Range .)
The numbers of children in families:
| Number of children | ||||||
|---|---|---|---|---|---|---|
| Frequency |
Find the median and the interquartile range.
Solution
Cumulative frequencies: .
: the median is halfway between the th and th values. Values to are all , so both are : median .
Lower half: values to . Its median is the th value. Values to are , so .
Upper half: values to . Its median is the th of these, i.e. the th value overall. Values to are , so .
children.
The times, in seconds, for swimmers are:
(a) Find the mean and the median. (b) The is found to belong to a swimmer who stopped mid-race, and is removed. Find the new mean and median. (c) Which average was more representative of the original data? Explain.
Solution
(a) , so the mean is s (3 s.f.). Ordered: . The median is the th value, s.
(b) Without : for values, mean s (3 s.f.). Median: halfway between the th and th, s.
(c) The median. In (a), of the times are s or less, yet the mean ( s) is larger than all but two of the times, because the single extreme value pulls it up. The median ( s) barely changes when the extreme value is removed.
The scores of some students are shown.
| Score | |||||
|---|---|---|---|---|---|
| Frequency |
Given that the median score is , find the smallest possible value of .
Solution
. The first values are or ; the scores of occupy positions to .
The median is when the middle position (or both middle positions, if is even) lies in positions to .
Try small values:
- : , median is the th value, which is . No.
- : , median is the mean of the th and th values, . No.
- : , median is the th value, which is . Yes.
For larger the middle position stays within the block of s, so the smallest value is .
Five positive integers have median , mean , a single mode , and range . Find the five integers.
Solution
Write them in order . The median is .
The mode is , and , so must appear at least twice among : . Then and must be different from each other (otherwise there would be a second mode).
Range: , so . Mean: the total is , so .
The integers are . Check: the mode is alone, the median is , the mean is and the range is .
Using for a cumulative frequency graph. For raw data and frequency tables use positions (th value). For a cumulative frequency graph of grouped data read at .
Not ordering the data first. The median of is not (the middle of the list as written); it is , the middle of .
Reading the frequency, not the value. In a frequency table, the median is a value of the variable (number of children), never a frequency or a cumulative frequency.
- State the positions: ", so the median is the mean of the th and th values". It earns the method mark even if you misread the table.
- For grouped data say "estimate". For raw data the median is exact.
- When asked for "a measure of spread" to go with the median, give the IQR. When asked to compare, quote both groups' values.
- Questions that say "explain why the median might be preferred to the mean" want: the data contain an extreme value (or are skewed), which affects the mean but not the median.
- Median: the th ordered value; mean of the two middle values when is even.
- , : medians of the lower and upper halves (exclude the median when is odd).
- , the spread of the middle ; range largest smallest.
- Frequency tables: use cumulative frequencies to locate positions.
- Grouped data: estimate from a cumulative frequency graph at , , .
- The median and IQR are not affected by extreme values; use them for skewed data or data with outliers.
Practice questions
- Find the median and interquartile range of .
- Find the median and interquartile range of .
- The shoe sizes of people are: size ( people), (), (), (), (), (), (). Find the median and interquartile range.
- For the shoe sizes in question 3, calculate the mean and say whether the mean, median or mode would be most useful to a shoe shop deciding which size to stock most of.
- The masses of parcels are grouped as (), (), (), () (kg). Estimate the median mass by linear interpolation.
- The salaries of the employees of a small company are (in thousands of dollars): . Find the mean and the median, and explain which better represents a typical salary.
- The numbers of pets owned by some families are shown: pets ( families), (), (), (), (). The median number of pets is . Find the set of possible values of .
- Seven integers have mean , median , a single mode , range , smallest value and interquartile range . Find the seven integers.
Answers
-
Ordered: ; . Median th . Lower half : . Upper half : . IQR .
-
Ordered: ; . Median . . . IQR .
-
Cumulative frequencies: . Median: mean of the th and st values, both size , so the median is . : median of values to , mean of the th and th, both , so . : median of values to , mean of the th and st, both , so . IQR .
-
, so the mean is . The mode (size ) is the most useful: the shop wants the size most people take, and is not a shoe size.
-
, so read at . Cumulative frequencies ; lies in : median .
-
, mean thousand dollars (3 s.f.). Median th value thousand dollars. The median: the one very large salary () pulls the mean above eight of the nine salaries, while the median is unaffected.
-
. Positions: s are –, s are –, s are –, then s are to . The median is when the middle position(s) lie in –. If is odd the median is the th value: need , i.e. . If is even both the th and the next value must be in –: need and , i.e. . Combining (and checking gives median and gives ): .
-
In order: . Range gives . The only values below the median are , and , and must appear at least twice, so . With , is the nd value () and the th (), so and . The total is , so . The integers are . Check: ascending order, only repeats, median , mean , range , IQR .