Grouped data: what you gain and what you lose
Grouping turns two hundred unreadable numbers into a table of six lines. The gain is obvious. The loss is that the individual values are gone: after grouping, you know that eleven students scored between 20 and 30, but not what any of them actually scored.
Everything that follows is a consequence. The mean has to be estimated using class midpoints. The mode becomes a modal class, not a value. The median has to be read from a graph rather than counted.
Histograms, and the trap of unequal class widths
A histogram looks like a bar chart with the gaps closed up, and while the classes are all the same width that is exactly what it is. The area of each bar represents the frequency, and when the widths are equal, area is proportional to height, so plotting the frequency works.
The moment the widths differ, plotting frequency as height is wrong: a class of width 20 would look twice as important as a class of width 10 with the same frequency. The vertical axis must then be frequency density, and the frequency is recovered as area = density × width.
The ogive plots each cumulative total at the upper boundary of its class. Reading across at N/2 gives the median, at N/4 the lower quartile and at 3N/4 the upper quartile.
Bar chart or histogram?
A bar chart shows separate categories, so the bars have gaps and only their heights carry meaning. A histogram shows continuous data, so the bars touch at the class boundaries and their areas carry the meaning. Drawing a histogram with gaps, or a bar chart without them, loses a mark in either direction.
The cumulative frequency curve
A cumulative frequency table records a running total: how many observations are at or below each class boundary. Plotting those totals against the upper class boundaries and joining them with a smooth curve gives the ogive.
Plotting at the midpoint instead of the upper boundary is the standard error, and it shifts every reading you take afterwards. The reason for the upper boundary is simple: the cumulative total "40 or fewer" is only complete once you reach the top of the 30–40 class.
From marks grouped 0–10 (2), 10–20 (5), 20–30 (9), 30–40 (12), 40–50 (8), 50–60 (4), build the cumulative frequency table and explain how to find the median.
- Running totals: 2, 7, 16, 28, 36, 40.Each entry is the previous total plus the new frequency. The last must equal Σf = 40, which is a built-in check.
- Plot (10, 2), (20, 7), (30, 16), (40, 28), (50, 36), (60, 40), and start the curve at (0, 0).Upper boundaries on the horizontal axis. The point (0, 0) is legitimate because nobody scored below zero.
- The median is the
N/2 = 20thvalue. Draw a horizontal line at 20 to meet the curve, then drop to the x-axis.For a cumulative frequency curve, use N/2 rather than (N+1)/2 — the curve is treating the data as continuous. - The reading is about 34 marks.Sanity check: 16 students scored under 30 and 28 under 40, so the 20th value must lie between 30 and 40. It does.
Cumulative frequencies 2, 7, 16, 28, 36, 40; median ≈ 34 marks
Quartiles and the interquartile range
The quartiles cut the ordered data into four equal parts. Read them off the ogive in exactly the same way as the median, at different heights.
The interquartile range is Q₃ − Q₁, the width of the middle half of the data. It is a far better measure of spread than the range for the same reason the median beats the mean: it ignores the extremes entirely, so one freak value cannot distort it.
Before you leave this chapter
- Grouping loses the individual values, so the mean becomes an estimate and the mode becomes a modal class.
- Equal class widths → plot frequency. Unequal widths → plot frequency density, and frequency is the area.
- A histogram has no gaps; a bar chart does.
- Plot cumulative frequency at the UPPER class boundary, never the midpoint.
- Read Q₁, median and Q₃ at N/4, N/2 and 3N/4. IQR = Q₃ − Q₁ and ignores the extremes.
Choosing the classes, and drawing an honest histogram
When you group the data yourself, the choice of class interval matters. Too few classes and the shape of the distribution disappears; too many and the frequencies are all 1 or 2 and the table tells you nothing. Between five and ten classes is the usual compromise, and they should be of equal width unless there is a good reason otherwise.
A good reason does sometimes exist. Income data, or examination marks with a long thin tail, may need wider classes where the data is sparse — and that is precisely when frequency density becomes compulsory.
Classes 0–10 (f = 15), 10–20 (f = 25) and 20–40 (f = 30). Find the height of each bar on a histogram.
- Class widths are 10, 10 and 20.The third class is twice as wide as the others, so raw frequency cannot be used as the height.
- Frequency densities:
15/10 = 1.5,25/10 = 2.5,30/20 = 1.5.Density = frequency ÷ class width. - Bar heights are 1.5, 2.5 and 1.5.The first and last bars have the same height even though the last has twice the frequency — because it is twice as wide, so its area is twice as large.
- Check the areas:
1.5 × 10 = 15,2.5 × 10 = 25,1.5 × 20 = 30✓Area returns the original frequency, which is exactly what a histogram is supposed to guarantee.
Heights 1.5, 2.5 and 1.5 in frequency density units