Histograms for Grouped Data
Data with many different values, grouped into classes of equal width: frequency tables, histograms numbered at the class boundaries, the modal class, and choosing the class width.
What You Should Already Know
- A histogram for ungrouped data (lesson 12.3) has one bar for each value; the bars touch, and the frequency axis starts at 0 in equal steps.
- The inequality means that is at least 150 and less than 160: 150 is included, 160 is not.
Why Group Data?
The heights of 40 pupils go from 142 cm to 178 cm. A histogram with one bar for each centimetre would need 37 bars, most of them 0, 1 or 2 high, and no pattern would show. When data have many different values and few repeats, we group them into classes and draw one bar for each class.
Classes
A class such as holds every value from 150 up to, but not including, 160. Its lower boundary is 150 and its upper boundary 160.
The classes follow on from one another with no gaps and no overlaps: the upper boundary of one class is the lower boundary of the next, so every value belongs to exactly one class. A value on a boundary, such as 160, goes in the class that starts there, .
Class width upper boundary lower boundary. In this lesson every class has the same width.
Example 1: Classes and boundaries
The heights of 40 pupils are grouped into the classes , , and , where cm is a height. (a) What is the class width? (b) In which class does each height go: 149.5 cm, 150 cm, 167.0 cm, 170 cm?
Solution
(a) Class width cm (the same for every class).
(b) 149.5 is at least 140 and less than 150: class .
150 is on a boundary. It is included in the class that starts at 150, , and not in .
167.0 is in , and 170 starts the class .
(a) 10 cm (b) 149.5 cm: ; 150 cm: ; 167.0 cm: ; 170 cm: .
Other ways of writing classes
Some books write classes the other way round, , with the upper boundary included. Always read which end a table includes. Writing "140–150, 150–160" is unclear, because 150 seems to be in both.
Grouped Frequency Tables and Histograms
Histogram for grouped data
Each class has one bar, as wide as the class and as tall as its frequency. The classes have equal widths, so the bars do too, and the bars touch.
The horizontal axis is a number scale, numbered at the class boundaries. If the first boundary is far from 0, a zigzag on the axis shows that part of the scale is left out.
The frequency axis starts at 0 and is numbered in equal steps.
Example 2: Grouping, drawing and the modal class
The waiting times, in whole minutes, of 36 patients at a pharmacy were: 26, 28, 16, 30, 10, 7, 12, 20, 3, 39, 41, 31, 24, 15, 14, 25, 36, 5, 11, 6, 9, 13, 17, 8, 35, 21, 23, 18, 19, 29, 2, 15, 38, 46, 34, 32. (a) Group the times into a frequency table with the classes , , …, . (b) Draw a histogram. (c) Which class has the highest frequency?
Solution
(a) Tally each time into its class. A time on a boundary goes in the class that starts there: 10 in , 20 in , 30 in .
| Time, min | Tally | Frequency |
|---|---|---|
| Total |
Check: the number of patients.
(b) Five touching bars of equal width, the axis numbered 0, 10, 20, 30, 40, 50 at the boundaries.
(c) The tallest bar is , with 11 patients.
(a) Frequencies 7, 11, 8, 8, 2 (total 36). (b) Drawn above. (c) : more patients waited 10 to under 20 minutes than in any other class.
The modal class
The modal class is the class with the highest frequency: the tallest bar of a grouped histogram.
It is the most common class, not where most of the data lie. In Example 2, 11 of the 36 patients are in the modal class; 25 are not.
Grouped data do not show the single values, so the mode itself cannot be read from them.
Reading a Grouped Histogram
A grouped histogram answers questions about whole classes. It cannot answer a question that cuts a class in two, because it does not show where in its class each value lies.
Example 3: Reading a grouped histogram
The histogram shows the time, in minutes, that each Secondary 2 pupil in a survey spent on homework one evening. (a) How many pupils spent from 60 to under 90 minutes? (b) How many spent at least 90 minutes? (c) How many pupils are shown? (d) What percentage spent less than 60 minutes? (e) What is the modal class? (f) Can you tell how many pupils spent more than 100 minutes?
Solution
(a) The bar reaches 22.
(b) At least 90 minutes is the classes and : pupils.
(c) pupils.
(d) Less than 60 minutes: pupils. Percentage (to 1 decimal place).
(e) The tallest bar: .
(f) No. All 6 pupils of spent more than 100 minutes, but the histogram does not show how many of the 12 in spent more than 100. The answer is somewhere from 6 to 18.
(a) 22 (b) 18 (c) 60 (d) 33.3% (e) (f) No: it is between 6 and 18, but the exact number cannot be read.
Choosing the Class Width
The same data can be grouped in different ways, and each way gives a different picture. Here are the 40 heights of lesson 12.2 grouped with widths 20 cm, 10 cm and 5 cm. Every histogram has 40 pupils.
Example 4: The same data, three widths
The heights of 40 pupils (from 142 cm to 178 cm) are drawn below in classes of width 20 cm, 10 cm and 5 cm. What does each histogram show, and which class width shows the data best?
Solution
Width 20 cm: only two bars, 17 and 23. All we learn is that a little more than half the pupils are 160 cm or taller; the shape is hidden.
Width 10 cm: four bars, 3, 14, 16 and 7. The heights rise to the class and fall after it.
Width 5 cm: eight bars, 2, 1, 4, 10, 8, 8, 3 and 4. Now the tallest bar is , a detail the width 10 histogram hid, and the heights from 155 cm to 170 cm are seen to hold 26 of the 40 pupils.
Each histogram is true to the data, but they tell different stories. A good width gives enough classes to show the shape, but not so many that most classes hold only one or two values.
Width 20 cm hides the shape; width 10 cm shows it in outline, with the modal class; width 5 cm shows the most, including the modal class . For 40 heights, width 5 cm or 10 cm is a sensible choice, 20 cm is not.
Spotting Errors
Example 5: What is wrong?
Find the fault in each of these. (a) A table with the classes "10–20, 20–30, 30–40" for the ages of a group of people. (b) A histogram of the masses of 25 parcels, in classes of 2 kg from 0 to 10 kg, with 6, 9, 5, 0 and 5 parcels, drawn as below. (c) A histogram of the times of 30 runners, in classes of 10 minutes from 0 to 40 minutes with 4, 9, 11 and 6 runners, drawn as below.
(b)
(c)
Solution
(a) The classes overlap: a person aged 20 could go in "10–20" or in "20–30". Write them as , , , so that every age has exactly one class.
(b) The class from 6 kg to 8 kg has no parcels, so it was left out: the axis jumps from 4 to 8 in one step, and the bar for 8 to 10 kg stands straight after 4 to 6 kg. The empty class must keep its place, with a bar of height 0, so that the gap in the data shows.
(c) The classes are written under the middle of each bar, as if they were the names of categories, and the boundaries are not numbered. The horizontal axis of a histogram is a number scale: number it at the class boundaries, 0, 10, 20, 30 and 40, at the edges of the bars, where one class meets the next. Written under the bars, "10 to 20" and "20 to 30" both name 20, and the axis does not show which class holds it.
(a) Overlapping classes. (b) An empty class left out. (c) The axis labelled under the bars instead of numbered at the class boundaries.
Common Mistakes
- Putting a value on a boundary in the wrong class: with , 20 goes in , not in .
- Writing classes that overlap ("10–20, 20–30") or leave gaps ("10–19, 21–30").
- Saying the modal class is "where most of the data are". It is only the class with the highest frequency: in Example 2, 11 of 36.
- Numbering the horizontal axis under the middle of each bar instead of at the class boundaries.
- Leaving out a class with frequency 0, or drawing gaps between the bars.
- Answering a question that cuts a class in two (more than 100 minutes, when the class is 90 to 120) as if the histogram could tell.
- Using classes of different widths. Keep every class the same width (lesson 12.6 shows how a class of a different width misleads).
Practice Questions
Try each question first, then open the solution to check your working.
Question 1
Masses, kg, are grouped into the classes , , and . (a) What is the class width? (b) In which class does each mass go: 24.9 kg, 25 kg, 35.0 kg? (c) What are the lower and upper boundaries of the third class?
ShowHide solution
(a) kg.
(b) 24.9 is less than 25: . 25 starts the next class: . 35.0 starts the class .
(c) The third class is : lower boundary 30, upper boundary 35.
(a) 5 kg (b) ; ; (c) 30 and 35
Question 2
The marks, out of 100, of 30 pupils in a test were: 45, 67, 82, 91, 56, 73, 88, 62, 75, 59, 84, 70, 77, 81, 68, 92, 58, 79, 86, 63, 74, 89, 65, 78, 71, 83, 60, 76, 87, 69. (a) Group the marks into a frequency table with the classes , , …, . (b) What is the modal class? (c) Is it true that most pupils scored from 70 to under 80?
ShowHide solution
(a) Tally each mark; 60 and 70 start their classes.
| Mark, | Tally | Frequency |
|---|---|---|
| Total |
Check:
(b) The highest frequency is 9, in .
(c) No. 9 of the 30 pupils is less than half. It is the most common class, not where most pupils scored.
(a) Frequencies 1, 3, 7, 9, 8, 2 (total 30). (b) (c) No: only 9 of 30 pupils are in it.
Question 3
The lengths of 40 leaves were measured. Draw a histogram of the table, numbering the frequency axis from 0 to 16 in steps of 2.
| Length, cm | Frequency |
|---|---|
| Total |
ShowHide solution
Five touching bars, the axis numbered 4, 6, 8, 10, 12, 14 at the boundaries, with a zigzag before 4 because the scale does not start at 0.
Drawn above.
Question 4
The histogram shows the ages of the 80 people at a community centre event. (a) How many people were at least 45 years old? (b) What percentage were under 30? (c) What is the modal class?
ShowHide solution
(a) and : people.
(b) and : . Percentage
(c) The tallest bar: (22 people).
(a) 30 (b) 35% (c)
Question 5
Using the histogram of Question 4, can you find how many people were 50 or older? Explain, and say what you can tell.
ShowHide solution
No. The class has 16 people, but the histogram does not show how many of them are 50 or older.
All 14 people in are 50 or older, and at most all 16 of are too. So the number is at least 14 and at most .
It cannot be found exactly; it is from 14 to 30.
Question 6
A survey of 100 shoppers found that the modal class of the time spent in a shopping centre was minutes, with 35 shoppers. A newsletter says, "Most shoppers spend 20 to 40 minutes in the centre." Explain why this is wrong, and write a correct sentence.
ShowHide solution
"Most" means more than half. 35 of 100 shoppers is less than half; 65 shoppers spent less than 20 or at least 40 minutes.
The modal class only says that more shoppers were in this class than in any other class.
35 of 100 is not most. Correct: "More shoppers spent from 20 to under 40 minutes than in any other class of the survey (35 of the 100)."
Question 7
The marks, out of 100, of 200 pupils are to be grouped. Explain why each of these class widths is a poor choice, and suggest a better one. (a) Width 1. (b) Width 50.
ShowHide solution
(a) With width 1 there would be about 100 classes, one for each mark, which is the same as not grouping: most bars would be only a few pupils high and many would be 0, so the pattern would be lost in the ups and downs.
(b) With width 50 there would be only 2 classes, and the shape of the marks would be hidden.
Width 10 gives 10 classes: , …, , and a last class , which includes 100 so that a full mark has a class.
(a) Too many classes (about 100): no grouping at all. (b) Too few (2): the shape is hidden. Width 10 is better, the last class being .
Question 8
Wei Jie grouped the times of a 2.4 km run into the classes "10–12, 12–14, 14–16, 16–18" minutes. His friend ran exactly 14 minutes. What is wrong with the classes, and how should they be written?
ShowHide solution
The classes overlap: 14 minutes could go in "12–14" or in "14–16", so it is not clear where his friend's time belongs.
Written with inequalities, every time has exactly one class: , , , . Then 14 minutes goes in .
The classes overlap at their ends. Write them as , , , ; 14 minutes is in .
Question 9
The masses, in kg, of 20 school bags were: 5.9, 3.5, 4.3, 3.0, 4.8, 4.1, 3.2, 5.0, 4.9, 2.8, 6.0, 2.4, 5.5, 3.5, 6.3, 4.0, 3.9, 6.8, 4.6, 5.2. (a) Group them with the classes , , …, . (b) Draw a histogram. (c) What is the modal class?
ShowHide solution
(a) 3.0, 4.0, 5.0 and 6.0 each start their classes.
| Mass, kg | Tally | Frequency |
|---|---|---|
| Total |
(b)
(c) The tallest bar is , with 6 bags.
(a) Frequencies 2, 5, 6, 4, 3 (total 20). (b) Drawn above. (c)
Question 10
45 pupils timed how long they took to solve a puzzle. One frequency is shown as . (a) Find . (b) Draw a histogram. (c) What is the modal class?
| Time, seconds | Frequency |
|---|---|
| Total |
ShowHide solution
(a) so and .
(b)
(c) The highest frequency is 14, in .
(a) (b) Drawn above. (c)
Key Points
- Group data into classes when they have many different values and few repeats.
- A class includes but not ; a value on a boundary goes in the class that starts there.
- Classes follow on with no gaps and no overlaps; class width upper boundary lower boundary, the same for every class.
- Tally the data into a grouped frequency table and check that the frequencies add up to the number of values.
- A grouped histogram has touching bars of equal width, the horizontal axis numbered at the class boundaries and the frequency axis from 0 in equal steps.
- The modal class is the class with the highest frequency, not "where most of the data are".
- A grouped histogram answers questions about whole classes only.
- The class width changes the picture: too wide hides the shape, too narrow leaves most classes nearly empty.