Topic 2 · Lesson 2 of 4
Grouped data, histograms and coding
Grouped data and histograms
When data come in classes, you don't know the exact values, so every calculation is an estimate.
- Mean and standard deviation: use the midpoint of each class as : and .
- Median and quartiles: use linear interpolation, which assumes the values are spread evenly through each class.
In a histogram, the area of each bar represents frequency, so classes of different widths are shown fairly. The height is the frequency density:
The diagram shows times taken by 70 people to finish a puzzle, in classes 0–10, 10–15, 15–20, 20–30 and 30–50 minutes with frequencies 8, 14, 20, 18 and 10. The 15–20 bar has width 5 and height 4, so area 20: twenty people. Without frequency density, the wide 30–50 class would look far more important than it is.
A frequency polygon joins the midpoints of the tops of the bars with straight lines; it is useful for comparing two distributions on one diagram. Histograms connect to probability: if the total area is scaled to 1, the area of a bar is the probability that a value falls in that class, which leads to continuous distributions like the Normal distribution.
Worked example
Grouped dataexam standard
For the puzzle data, estimate a) the number of people who took between 12 and 25 minutes, b) the median, c) the mean and standard deviation.
Show solutionHide solution
- a) Use areas. 12–15: width 3 at density 2.8, so 8.4. 15–20: 20. 20–25: width 5 at density 1.8, so 9. Total people.
- b) The median is the th value. Cumulative frequencies are 8, 22, 42, so it is in the 15–20 class, values into a class of 20. Interpolate: minutes.
- c) Midpoints 5, 12.5, 17.5, 25, 40. , so minutes.
- , so and minutes.
For grouped data, use the th value for the median (and th, th for quartiles), because the data are treated as continuous. The same readings can be made from a cumulative frequency graph, plotting cumulative frequency at each upper class boundary, as below; here , median 18.25 and .
Coding
Coding changes every value by a rule such as to make numbers easier. Think about what each step does:
- Adding or subtracting a constant shifts every value, so it changes the mean by that constant but does not change the spread.
- Multiplying or dividing by scales everything, so it scales the mean and the standard deviation by (the variance by ).
So if , then and . Always decode by reversing the steps.
Worked example
Codingexam standard
Masses grams are coded with . For 20 items, and . Find the mean and standard deviation of .
Show solutionHide solution
- and , so .
- Decode: , so g.
- The doesn't affect spread: g.
Practise this topic
Both are part of Premium.