4  Class Intervals and Grouping

When a quantitative variable can take dozens or hundreds of distinct values, such as the marks of 200 students or the income of 500 households, listing every value individually stops being useful. The solution is grouping: dividing the full range of the data into a small number of class intervals, then working with counts of observations that fall into each interval rather than every raw value. This chapter covers the vocabulary and rules for building class intervals correctly.

4.1 Key Terms in Grouped Data

  • Class: A group or interval into which data values are sorted, such as “40–50.”
  • Class Limits: The lowest and highest values that define a class, called the lower class limit and upper class limit. In “40–50,” 40 is the lower limit and 50 is the upper limit.
  • Class Boundaries (True Limits): The values that separate one class from the next with no gap between classes, obtained by adjusting the class limits by half the gap between the upper limit of one class and the lower limit of the next.
  • Class Width (Class Size): The difference between the upper and lower class boundaries of a class. All classes in a distribution are usually, though not always, given equal width.
  • Class Mark (Mid-Point): The midpoint of a class, calculated as the average of its lower and upper limits. It represents every value in that class for many later calculations, such as the mean of grouped data.
  • Range: The difference between the highest and lowest values in the entire dataset, the raw material used to decide how many classes are needed.

\[\text{Class Width} = \text{Upper Class Boundary} - \text{Lower Class Boundary}\]

\[\text{Class Mark} = \frac{\text{Lower Class Limit} + \text{Upper Class Limit}}{2}\]

\[\text{Range} = \text{Maximum Value} - \text{Minimum Value}\]

4.2 Exclusive and Inclusive Methods

Class intervals can be constructed in two ways, and the choice affects how boundary values are treated.

  • Exclusive Method: The upper limit of one class is the same as the lower limit of the next, and an observation exactly equal to that shared value is counted in the higher class. For example, 10–20, 20–30, 30–40 means a value of exactly 20 goes into the 20–30 class, not the 10–20 class. This method is preferred for continuous data because classes touch with no gap.
  • Inclusive Method: Both the lower and upper limits belong to the same class, and there is a visible gap between one class’s upper limit and the next class’s lower limit, such as 10–19, 20–29, 30–39. This method is intuitive for discrete data, but for continuous data it needs to be converted to class boundaries before further calculation.

Example: Converting Inclusive Limits to Class Boundaries

Given the inclusive classes 10–19, 20–29, 30–39, the gap between the upper limit of one class (19) and the lower limit of the next (20) is 1. Half of this gap, 0.5, is subtracted from every lower limit and added to every upper limit to obtain continuous class boundaries:

Inclusive Class Class Boundaries
10–19 9.5–19.5
20–29 19.5–29.5
30–39 29.5–39.5

4.3 Deciding the Number of Classes and Class Width

Two decisions have to be made before a grouped frequency distribution can be built: how many classes to use, and how wide each class should be. Both decisions are guided by Sturges’ Rule, a formula that recommends a number of classes based on the sample size.

\[k = 1 + 3.322 \log_{10}(N)\]

where \(k\) is the recommended number of classes and \(N\) is the total number of observations. Once \(k\) is known, the approximate class width \(h\) is found by dividing the range by \(k\) and rounding up to a convenient number:

\[h = \frac{\text{Range}}{k}\]

Example

Suppose 60 students took an exam, with the lowest score 32 and the highest score 97. Using Sturges’ Rule:

  1. Range \(= 97 - 32 = 65\).
  2. \(k = 1 + 3.322 \log_{10}(60) = 1 + 3.322(1.778) \approx 1 + 5.91 \approx 6.91\), rounded to 7 classes.
  3. \(h = 65 / 7 \approx 9.3\), rounded up to a convenient width of 10.

So the data could be grouped into 7 classes of width 10 each, starting from 30: 30–40, 40–50, 50–60, 60–70, 70–80, 80–90, 90–100.

Sturges’ Rule is a guideline, not a rigid law. In practice, most well-constructed frequency distributions use somewhere between 5 and 20 classes. Too few classes hide important patterns in the data, while too many classes leave each class with hardly any observations, which is just as uninformative as the raw data you started with. Round the suggested class width to a convenient number, such as 5, 10, or 20, rather than an awkward decimal, so the final table is easy to read.

Three mistakes show up repeatedly when analysts build class intervals by hand: overlapping class limits that make it ambiguous which class a boundary value belongs to, class widths that are unequal without a clear reason, which distorts any later histogram, and open-ended first or last classes, such as “above 90,” which are sometimes unavoidable but make it impossible to compute an exact class mark or mean for that class.

4.4 Constructing the Class Intervals

Putting the previous sections together, building class intervals for a raw dataset follows a consistent sequence of steps.

  1. Find the range of the data (maximum minus minimum).
  2. Decide the number of classes \(k\) using Sturges’ Rule, or a similar practical guideline.
  3. Compute the approximate class width \(h\) and round it to a convenient value.
  4. Choose a starting point at or just below the minimum value, and mark off successive classes of width \(h\) until the maximum value is covered.
  5. Decide whether to use the exclusive or inclusive method, and convert to class boundaries if needed.
Looking Ahead

With the class intervals constructed, the next chapter puts observations into those classes, counts how many fall into each one, and builds the complete frequency distribution table, along with cumulative frequencies and the histograms used to visualize it.


Summary

Concept Description
Key Terms
Class A group or interval into which raw data values are sorted
Class Limits The lowest (lower limit) and highest (upper limit) values that define a class
Class Boundaries The true limits separating classes with no gap, adjusted from the class limits
Class Width The difference between the upper and lower class boundaries of a class
Class Mark The midpoint of a class, calculated as the average of its lower and upper limits
Range The difference between the highest and lowest values in the dataset
Exclusive vs Inclusive
Exclusive Method A class-building method where the upper limit of one class equals the lower limit of the next
Inclusive Method A class-building method where both limits belong to the same class, leaving a visible gap between classes
Sturges' Rule
Sturges' Rule A formula, k = 1 + 3.322 log10(N), that recommends a number of classes based on sample size
Recommended Class Width The range divided by the recommended number of classes, rounded to a convenient value
Common Mistakes
Too Few Classes Hides patterns in the data by lumping too many observations into each class
Too Many Classes Leaves each class with too few observations to be informative
Unequal Class Widths Distorts the visual comparison of bar heights in a later histogram
Open-Ended Classes Classes such as "above 90" that make an exact class mark or mean impossible to compute