Stem-and-Leaf Diagrams
A stem-and-leaf diagram sorts a small set of raw data into order while keeping every value visible. It looks like a bar chart turned on its side, so you see the shape of the distribution, and because the values are in order you can read off the median and quartiles exactly. On Paper 5 you are asked to draw them (including back-to-back diagrams for two data sets), to read medians and quartiles from them, and to use them to compare two groups.
How the diagram works
Split each value into a stem (the leading digit or digits) and a leaf (the final digit). Values with the same stem share a row, and the leaves are written in a line to the right of the stem.
For the value : stem , leaf . For : stem , leaf . For : stem , leaf .
A stem-and-leaf diagram displays raw data by writing each value as a stem and a single-digit leaf. In an ordered stem-and-leaf diagram the leaves in each row are in increasing order. A key states what a stem and leaf represent, including units, for example " represents ".
Three rules make a diagram correct.
- Every leaf is one digit. If the data have three significant figures, the stem carries two of them.
- The leaves are ordered, smallest next to the stem. Examiners almost always require an ordered diagram; an unordered one usually loses a mark.
- There is a key with units. Without a key, "" could mean , or . A missing key is the single most common lost mark on this topic.
Leaves should be lined up in columns, evenly spaced, so the length of each row shows how many values it holds. That is what lets the diagram show shape.
- Choose the stems so there are roughly to rows. Write them in a column, in increasing order downwards, including any stems with no leaves.
- Go through the data once, writing each leaf against its stem (an unordered diagram).
- Redraw with the leaves in each row in increasing order.
- Count the leaves and check the total equals the number of data values.
- Write a key with units.
Reading the median and quartiles
Because the values are in order, you count along the leaves.
For ordered values:
- Median: the th value. If is even this is halfway between the two middle values.
- Lower quartile : the median of the lower half of the data.
- Upper quartile : the median of the upper half of the data.
- If is odd, the median itself is left out of both halves.
- Range largest smallest; interquartile range .
For example, with the median is the th value, the lower half is values to so is the th, and the upper half is values to so is the th. With the median is halfway between the th and th values, the lower half is values to so is halfway between the th and th, and is halfway between the th and th.
When counting, write running totals down the right-hand side of the diagram (a cumulative count for each row). Then "the th value" is found instantly: it is in the first row whose running total reaches .
Shape
Turn the diagram so the stems run along the bottom and you have a bar chart of the data. A diagram whose rows are longest near the top (small values) with a long tail of short rows towards larger values is positively skewed. Longest rows near the bottom with a tail towards small values is negatively skewed. Roughly equal tails either side of a central bulge is symmetrical. You will meet skew properly in the box-and-whisker note.
Back-to-back diagrams
To compare two data sets, share one column of stems and put one set's leaves on the right and the other's on the left. The left-hand leaves are ordered outwards from the stem, so on the left the smallest leaf is next to the stem and the leaves get bigger as you read leftwards.
The key must explain both sides, for example " represents marks for Group A and marks for Group B". Reading the left side backwards is the classic error, so read it slowly: on the left of stem , leaves written as "" represent , and .
Worked examples
The masses, in grams, of tomatoes are:
(a) Draw an ordered stem-and-leaf diagram. (b) Find the median and the interquartile range.
Solution
(a)
| Stem | Leaves | Running total |
|---|---|---|
Key: represents .
(b) , so the median is halfway between the th and th values: .
Lower half: values to . is halfway between the th and th: .
Upper half: values to . is halfway between the th and th: .
Interquartile range .
The masses, in grams, of apples are:
Draw an ordered stem-and-leaf diagram and find the median, the quartiles and the range.
Solution
Leaves must be single digits, so the stems are .
| Stem | Leaves | Running total |
|---|---|---|
Key: represents .
. Median: halfway between the th and th values, .
Lower half is values to : is the th value, . Upper half is values to : is the th value, .
Range .
The marks of students in Group A and students in Group B are shown.
| Group A | Group B | |
|---|---|---|
Key: represents marks for Group A and marks for Group B.
(a) Find the median and interquartile range for each group. (b) Make two comparisons between the marks of the two groups.
Solution
Reading Group A (leaves outwards from the stem): .
Reading Group B: .
(a) for each, so the median is the th value, the th and the th.
Group A: median , , , IQR .
Group B: median , , , IQR .
(b) The medians are almost the same ( and ), so on average the two groups scored similarly, with Group B very slightly higher. Group A's marks are more spread out: its IQR () is larger than Group B's (), so Group B's marks are more consistent.
For the data set (Group P, marks):
(a) Find the median and interquartile range. (b) It is discovered that the mark should have been . Find the corrected median and interquartile range, and explain why the median changes.
Solution
(a) Median th value . th . th . IQR .
(b) The corrected ordered data are .
Median th . th . th . IQR .
The median changes because the corrected value has moved from above the median to below it, which shifts every value in the upper half down one place. If had been corrected to, say, , it would still be above the median and the median would be unchanged.
The times, in minutes, taken by people to complete a puzzle are shown in an ordered stem-and-leaf diagram, where and are unknown digits.
| Stem | Leaves |
|---|---|
Key: represents minutes.
The median time is minutes and the mean time is minutes.
(a) Find and . (b) Find the interquartile range.
Solution
(a) , so the median is the th value. Counting: are the first five, so the th is . Hence , giving .
The total of the times is .
The known values sum to , and the remaining value is . So
Check the order: in row the leaves are , which are increasing, so is consistent.
(b) The data are . is the median of the lower five values (rd value) , and is the median of the upper five (th value) . IQR minutes.
Reading the left-hand side of a back-to-back diagram the wrong way. On the left, the leaf next to the stem is the smallest. Leaves "" on the left of stem mean (so when counting up to a median you meet first, reading leftwards from the stem), and they certainly do not mean . Use the key to check one value before reading the rest.
Counting the median from the stems. The median is the middle value, found by counting leaves, not the middle stem. A row with no leaves still has to appear in the diagram, but contributes nothing to the count.
Uneven spacing. If one row's leaves are cramped and another's spread out, the diagram misrepresents the shape. Line the leaves up in columns.
- Always write the key, with units, even if the question does not explicitly ask for one. For a back-to-back diagram the key must explain both sides.
- "Draw a stem-and-leaf diagram" means an ordered diagram unless told otherwise.
- When the question gives the stems (for example "use a stem of and a leaf of "), you must use them.
- Show which positions you used (" is the th value") so method marks are available even if you miscount.
- Comparisons must be in context and must mention both an average and a spread: "Group B's marks were higher on average (median against ) and less spread out (IQR against )."
- Each value splits into a stem and a single-digit leaf; leaves are ordered and evenly spaced.
- A key with units is compulsory; a back-to-back key explains both sides.
- Left-hand leaves in a back-to-back diagram increase away from the stem.
- Median: the th value. Quartiles: medians of the lower and upper halves (leaving out the median when is odd).
- The diagram keeps all the raw data and shows shape; it is best for small data sets and for comparing two small sets.
- A changed value only moves the median if it crosses from one side of the median to the other.
Practice questions
- The ages, in years, of people at a meeting are: . Draw an ordered stem-and-leaf diagram and find the median, quartiles and range.
- The lengths, in cm, of leaves are: . Draw a stem-and-leaf diagram with a suitable key, and find the median and the interquartile range.
- In a back-to-back stem-and-leaf diagram the key reads " represents seconds for team X and seconds for team Y". On the left of stem the leaves are written "". Write down the three times they represent, and say which team they belong to.
- A stem-and-leaf diagram for values is shown, where and are digits.
| Stem | Leaves |
|---|---|
Key: represents . The median is and the upper quartile is . Find and , and the interquartile range. 5. The times, in minutes, taken by two groups of students to finish a task are: Group L: . Group R: . Draw a back-to-back stem-and-leaf diagram, with Group L on the left. 6. For the data in question 5, find the median and interquartile range of each group and make two comparisons in context. 7. For Group R in question 5, two more students are added with times and minutes. Without listing all the data, explain why the median of Group R is unchanged, then find the new quartiles. 8. Give one advantage of the back-to-back stem-and-leaf diagram in question 5 over a pair of box-and-whisker plots, and one advantage of the box plots over the stem-and-leaf diagram.
Answers
- Ordered: .
| Stem | Leaves |
|---|---|
Key: represents years. : median th ; th ; th ; range years.
- Stems ; leaves are tenths.
| Stem | Leaves |
|---|---|
Key: represents . : median . (between th and th). (between th and th). IQR .
-
They are on the left, so they belong to team X. Reading outwards from the stem: , and seconds.
-
: median is the th value. Rows and hold values, so the th is the second leaf in row : , so . The upper half is values to , so is the th value. Rows to hold values, so the th is the third leaf in row : , so (consistent with order ). is the th value . IQR .
| Group L | Group R | |
|---|---|---|
Key: represents minutes for Group L and minutes for Group R.
-
: median halfway between the th and th; the th; the th. Group L: median , , , IQR . Group R: median , , , IQR . Group L took less time on average (median against minutes). Group L's times were more varied (IQR against minutes), so Group R was more consistent.
-
One new value () is below the old median and one () is above it, so the two middle values are still and , now the th and th of . The median stays . New ordered data: . ; .
-
The stem-and-leaf diagram keeps every individual time (and shows the shape of each distribution). The box plots show the medians and quartiles directly, so the averages and spreads of the two groups can be compared at a glance.