Representation of data
How to choose, draw and read stem-and-leaf diagrams, box-and-whisker plots, histograms and cumulative frequency graphs, and how to calculate and use the mean and standard deviation, including from totals, coded totals and two combined data sets.
What the syllabus says
5.1 (Paper 5)
- select a suitable way of presenting raw statistical data, and discuss advantages and/or disadvantages that particular representations may have
- draw and interpret stem-and-leaf diagrams, box-and-whisker plots, histograms and cumulative frequency graphs
- understand and use different measures of central tendency (mean, median, mode) and variation (range, interquartile range, standard deviation)
- use a cumulative frequency graph
- calculate and use the mean and standard deviation of a set of data (including grouped data) either from the data itself or from given totals and , or coded totals and , and use such totals in solving problems which may involve up to two data sets.
Notes and examples
- Including back-to-back stem-and-leaf diagrams.
- e.g. in comparing and contrasting sets of data.
- e.g. to estimate medians, quartiles, percentiles, the proportion of a distribution above (or below) a given value, or between two values.
Quoted from the Cambridge International AS and A Level Mathematics 9709 syllabus (2026-2027 and 2028-2030 editions, which share this content).
Choosing a way to present data
Statistics starts with a list of values, the raw data. Before calculating anything, decide how to show the data so that its important features can be seen. Paper 5 expects you to choose a suitable diagram and to say what it shows well and what it hides.
- Stem-and-leaf diagram. Every value is kept, so you can still find the exact median, quartiles and mode, and the diagram also shows the shape of the distribution. It only works for a fairly small data set (up to about 50 values) recorded as numbers with a sensible stem. A back-to-back stem-and-leaf diagram puts two data sets on one stem, which makes them easy to compare.
- Box-and-whisker plot. It shows five numbers only: the lowest value, the lower quartile, the median, the upper quartile and the highest value. It is excellent for comparing two or more data sets side by side, because the medians and the spreads are visible at a glance. Its disadvantage is that the individual values, the mode and the number of values are all lost.
- Histogram. Used for continuous data that has been grouped, especially a large data set. The area of each bar represents the frequency, so classes may have unequal widths. The original values are lost, so any statistic calculated from a histogram is an estimate.
- Cumulative frequency graph. Also for large grouped data sets. It is the best diagram for estimating the median, the quartiles, any percentile and the number of values above, below or between given values.
A good answer to "give one advantage" names a specific feature and ties it to the context, for example "a stem-and-leaf diagram shows every individual mass, so the exact median can be found", rather than "it is clearer".
Stem-and-leaf diagrams
A stem-and-leaf diagram splits each value into a stem (the leading digits) and a leaf (the last digit). The leaves in each row are written in increasing order, and the diagram must have a key, such as means 47 kg. Without a key the diagram is incomplete and loses a mark.
Because the values are in order, the median of values is the th value. When is even this is halfway between the two middle values. The lower quartile is the median of the lower half of the data and the upper quartile is the median of the upper half. When is odd, leave the median itself out of both halves. For example, with 11 values the median is the 6th value, and the quartiles are the 3rd and 9th values. The interquartile range is .
In a back-to-back diagram the leaves of the left-hand data set are written outwards from the stem, so they are read from right to left: in the row the left-hand values are 52, 55 and 58. Count carefully on that side, since it is the side where most slips happen.
To compare two data sets, always give one comparison of a measure of central tendency (for example the medians) and one of a measure of spread (for example the interquartile ranges), each in the context of the question: "the swimmers' pulse rates are lower on average and less spread out".
Worked example 1
The times, in seconds, taken by two groups of 11 students to solve a puzzle are shown.
Group P: 23, 27, 31, 34, 35, 38, 41, 42, 46, 50, 57
Group Q: 19, 22, 24, 25, 29, 30, 30, 33, 36, 37, 44
(a) Draw a back-to-back stem-and-leaf diagram. (b) Find the median and the interquartile range of each group. (c) Compare the two groups.
(a) Use stems 1, 2, 3, 4 and 5. Group P's leaves go on the left, written outwards: the row for stem 3 reads . Key: means 31 seconds for P and 30 seconds for Q.
(b) There are 11 values, so the median is the 6th value and the quartiles are the 3rd and 9th values.
Group P: median 38, , , so the interquartile range is seconds.
Group Q: median 30, , , so the interquartile range is seconds.
(c) Group Q took less time on average (median 30 s compared with 38 s), and Group Q's times were slightly less spread out (interquartile range 12 s compared with 15 s).
Answer: P: median 38 s, IQR 15 s. Q: median 30 s, IQR 12 s. Q was faster on average and more consistent.
Box-and-whisker plots
A box-and-whisker plot (box plot) is drawn against a scale. The box runs from the lower quartile to the upper quartile, a line across the box marks the median, and the whiskers run out to the lowest and highest values. So the box holds the middle half of the data, and each whisker holds a quarter of it.
That fact is useful for estimates: if 80 people are represented, about 20 of them lie above the upper quartile and about 60 lie above the lower quartile.
A question may define an outlier, commonly as a value more than the interquartile range below or above . Use the definition the question gives. An outlier is usually plotted as a separate cross, with the whisker stopping at the most extreme value that is not an outlier.
When you draw a box plot, use a ruler and a labelled linear scale, and plot all five values accurately. Two box plots drawn against the same scale are the standard way to compare two data sets.
Histograms
In a histogram there are no gaps between the bars, because the data is continuous, and the area of each bar is proportional to the frequency. With classes of unequal width the height must therefore be the frequency density:
Why? A wide class collects values from a longer interval, so its frequency is naturally larger. Dividing by the width gives the frequency per unit, which is what can be compared fairly between classes. If you plotted frequency instead, a wide class would look far more important than it is.
Use the true class boundaries. A class written has boundaries 20 and 30 and width 10. If lengths are recorded to the nearest centimetre and a class is written 20 to 29, its boundaries are 19.5 and 29.5, but its width is still 10. If ages are given in completed years, the class 20 to 29 means .
Reading a histogram backwards, frequency = frequency density class width. To estimate how many values lie in part of a class, assume the values are spread evenly across the class and take the matching fraction of its frequency. Sometimes the vertical scale is not labelled, and you are told the frequency of one class. Use that class to find how much frequency one unit of area stands for.
Worked example 2
The times, minutes, that 80 commuters spent travelling are summarised below.
: 12, : 20, : 24, : 16, : 8
(a) Find the frequency density of each class. (b) Estimate the number of commuters who travelled for more than 25 minutes.
(a) Divide each frequency by its class width: , , , , .
These are the heights of the bars. Notice that the class has the tallest bar even though its width is only 5.
(b) From 25 to 30 is half of the class , so estimate commuters there.
All 8 commuters in also took more than 25 minutes, so the estimate is .
Answer: (a) 1.2, 4, 4.8, 1.6, 0.4 (b) 16
Check yourself
A class has frequency 27. Find the frequency density for this class.
Answer it in the portal, where your answer is checked as you type →
Cumulative frequency graphs
A cumulative frequency is a running total: the number of values less than or equal to the upper boundary of each class. To draw the graph, plot each cumulative frequency against the upper class boundary of its class, starting with a point at the lower boundary of the first class with cumulative frequency 0. Join the points with a smooth curve or with straight lines, as the question directs.
Plotting at the upper boundary matters. The cumulative frequency 52 for the class means 52 values are at most 4, not at most 3, so the point is . Plotting at mid-values is a common error and costs the mark for the graph.
For values read from the graph:
- the median at cumulative frequency ;
- the lower and upper quartiles at and ;
- the th percentile at , so the 90th percentile is at ;
- the number below a value by reading up from , and the number above as minus that reading;
- the number between two values as the difference of two readings.
Draw the reading lines on the graph in the exam: across from the cumulative frequency, then down to the axis. All of these are estimates, because the graph assumes the values are spread evenly within each class.
Measures of central tendency and variation
A measure of central tendency is a typical value:
- the mean uses every value, but an extreme value can pull it a long way;
- the median is the middle value, and it is not affected by a few extreme values;
- the mode is the most common value, and it is the only average for non-numerical data.
A measure of variation tells you how spread out the data is:
- the range is highest minus lowest, which is quick to find but depends on two values only, so one extreme value distorts it;
- the interquartile range is , the spread of the middle half, so it ignores extreme values;
- the standard deviation measures the typical distance of the values from the mean, and uses every value.
Pair them sensibly: the median with the interquartile range, the mean with the standard deviation. If the data has an extreme value, the median and interquartile range describe it better. If the data is roughly symmetrical with no extreme values, the mean and standard deviation use all the information and are preferred.
Mean and standard deviation from data and from totals
The variance is the mean of the squared deviations from the mean, and the standard deviation is its square root. MF19 gives both forms:
The second form is the one to use with totals. It says: variance = (mean of the squares) (square of the mean). The two forms agree because expanding gives .
In Paper 5 you divide by , not by . (Dividing by belongs to Paper 6, where it estimates a population variance from a sample.)
For grouped data use the mid-value of each class as and the frequencies :
These are estimates, because every value in a class is treated as if it were the mid-value.
On your calculator use statistics mode to check, but show the substitution in the formula: unsupported answers from a calculator earn no marks.
The totals can also be used backwards. If you know , and the standard deviation , then and . This is the key step in any question that adds or removes a value, or combines two data sets.
Check yourself
For 15 values, and . Find the standard deviation, correct to 3 significant figures.
Answer it in the portal, where your answer is checked as you type →
Coded totals and combining two data sets
Data is often coded by subtracting a convenient number from every value, so the totals are smaller. You are then given and .
Subtracting moves every value by the same amount, so it moves the mean by but does not change the spread at all. That gives:
Notice that the standard deviation is worked out entirely from the coded totals, with no added back.
To recover the uncoded totals, expand: , so . And , so . The and terms come from adding or once for each of the values: forgetting the is the commonest slip.
Two data sets. To combine two data sets, never average the two means or the two standard deviations. Instead, add the totals: , and . Then use the formulas on the combined totals. If you are given means and standard deviations instead of totals, first turn each into and as above.
Worked example 3
For 20 values of , and . Find the mean and the standard deviation of .
Coded mean: , so .
Variance .
Standard deviation (3 s.f.). The 50 is not added to the standard deviation, because shifting the data does not change its spread.
Answer: Mean 51.8, standard deviation 4.21
Check yourself
For 10 values of , and . Find the mean of .
Answer it in the portal, where your answer is checked as you type →
Worked example 4
Data set A has 12 values with and . Data set B has 8 values with and .
(a) Find the mean and standard deviation of data set A. (b) The two data sets are combined. Find the mean and standard deviation of all 20 values.
(a) .
Variance of A , so the standard deviation is (3 s.f.).
(b) Add the totals: , , .
Combined mean .
Combined variance , so the standard deviation is (3 s.f.).
Check that this is sensible: B's mean is 17.5, so the combined mean lies between 15.5 and 17.5, nearer A's because A has more values.
Answer: (a) 15.5, 4.15 (b) 16.3, 4.34
Check yourself
Data set C has 5 values with and . Data set D has 5 values with and . Find the variance of the combined 10 values.
Answer it in the portal, where your answer is checked as you type →
Key points
Stem-and-leaf diagrams keep every value and need a key. Box plots show five numbers and are best for comparing. Histograms and cumulative frequency graphs are for large grouped continuous data.
For an odd number of values , the median is the th value; the quartiles are the medians of the halves either side of it.
Histogram heights are frequency densities: frequency class width. Area represents frequency.
Plot cumulative frequency at upper class boundaries. Read the median at , quartiles at and , the th percentile at .
Standard deviation , dividing by . For grouped data use mid-values.
Coded data: add back to the mean only. The standard deviation is unchanged by subtracting .
To combine data sets, add , and , then use the formulas. turns a standard deviation back into a total.
Where marks are lost
Leaving the key off a stem-and-leaf diagram, or reading the left side of a back-to-back diagram the wrong way round.
Drawing histogram bars with height equal to frequency when the classes have different widths, or using the wrong class width for classes like 20 to 29 (the width is 10).
Plotting cumulative frequencies at mid-values instead of upper class boundaries, or reading the median at from a graph.
Dividing by in the standard deviation, or forgetting to take the square root of the variance.
Adding the code to the standard deviation, or forgetting the and terms when recovering and .
Averaging two standard deviations (or two means of different-sized groups) instead of combining the totals.
Comparing data sets without context, or giving two comparisons of averages and none of spread.
Related AS & A Level Mathematics 9709 lessons
An original lesson written to the Cambridge International AS & A Level Mathematics 9709 syllabus (2026 to 2027 and 2028 to 2030). The worked examples and questions are our own, not Cambridge questions. Back to every AS & A Level Mathematics 9709 lesson.