Calculating Mean and Variance for Grouped Data
In large-scale surveys, scientific experiments, or census reports, raw individual observations are frequently consolidated into grouped frequency tables (such as age brackets , or score ranges).
Once data is grouped into intervals, individual raw numbers are lost. We no longer know the exact values within each class—only how many observations fell inside that interval. To calculate the mean, variance, and standard deviation on paper, statisticians adopt a fundamental modeling assumption: all observations in a class are represented by the class midpoint.
The Midpoint Approximation Principle
Because actual data points are distributed throughout the interval rather than concentrated exactly at the center, all grouped measures are estimates. As long as intervals are reasonably narrow and symmetric, this approximation is remarkably accurate.
Formula Box: Grouped Summary Statistics
Let be the number of classes, the midpoint of class , and the frequency of class .
Median by Linear Interpolation (School Paper Formula)
To estimate the median value within the median class:
where:
- = lower boundary of the median class
- = total frequency ()
- = cumulative frequency of the class immediately before the median class
- = frequency of the median class itself
- = width of the median class
Step-by-Step Paper Notebook Method
To calculate grouped statistics cleanly without messy scratch paper, lay out a structured -column paper table:
| Col 1: Class Interval |
Col 2: Midpoint () |
Col 3: Frequency () |
Col 4: |
Col 5: |
Step-by-Step Execution:
- Fill Columns 1, 2, and 3: Compute each midpoint and write the given frequencies .
- Compute Column 4 (): Multiply Col 2 by Col 3.
- Compute Column 5 (): Use the paper multiplication trick:
(Multiplying Col 4 by Col 2 is far faster and less error-prone than squaring first and then multiplying by !)
- Sum the Key Columns:
- Sum Col 3 to get .
- Sum Col 4 to get .
- Sum Col 5 to get .
- Compute the Mean: .
- Compute Sample Variance () and Standard Deviation ():
- Correction term: .
- .
- , then .
Worked Examples
Example 1: Full Paper Table Calculation of Mean and Standard Deviation
Problem: A school library records the duration of visits (in minutes) for a sample of students:
| Duration () |
Frequency () |
|
|
|
|
|
|
|
|
Calculate the estimated sample mean , sample variance , and sample standard deviation on paper.
Step-by-Step Paper Solution:
Calculate Midpoints:
Construct the Calculation Table:
| Class |
Midpoint () |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Total |
— |
|
|
|
Calculate the Estimated Mean ():
Calculate the Correction Term:
(Paper shortcut check: .)
Calculate the Sample Variance ():
Divide by :
Calculate the Sample Standard Deviation ():
Example 2: Modal Class and Median by Linear Interpolation
Problem: Using the library visit data from Example 1:
- Identify the modal class.
- Estimate the median visit duration using linear interpolation on paper.
Step-by-Step Paper Solution:
Find the Modal Class:
- Frequencies are: .
- The highest frequency is , belonging to interval .
- Modal class: .
Locate the Median Class:
- Sample size .
- The middle position is .
- Cumulative frequencies:
- Class 1 ():
- Class 2 ():
- Since , the student falls exactly at the upper boundary of class .
- Median class is .
Apply Linear Interpolation Formula:
- Lower boundary
- Class width
Final Answer:
- Modal class:
- Estimated Median:
Example 3: Why Grouped Statistics Are Estimates (Grouping Error)
Problem: Consider three exact raw measurements: .
- Calculate the exact sample mean and exact sample variance.
- Group all three measurements into a single class with midpoint and frequency . Calculate the grouped sample mean and grouped sample variance.
- Explain the discrepancy.
Step-by-Step Paper Solution:
Exact Raw Calculations:
Grouped Calculations:
- Midpoint , .
- Since all three values are assigned to the midpoint , every deviation .
Analysis:
- Grouping assumed the data was centered at , whereas all raw values were near the lower end ().
- This difference is called grouping error. To minimize grouping error on paper, class intervals should be kept appropriately narrow and evenly distributed.
Common Mistakes & Paper Traps
The vs Trap:
- The most common algebraic error in grouped statistics!
- , which squares the frequency.
- We require .
- Safe method: Multiply your column by the column.
Dividing by (Number of Classes) Instead of :
- Writing when there are classes, forgetting that .
- Always divide by the total number of observations .
Wrong Midpoint for Inclusive Paper Intervals:
- If an interval is written as for discrete integer data, the true mathematical class limits are and .
- The midpoint is and . Always compute .
Forgetting in Sample Variance:
- Remember that for sample variance, the denominator is , not .
Pencil & Paper Practice
Practice 1
A seedling nursery records the heights of tomato plants:
| Height () |
Frequency () |
|
|
|
|
|
|
|
|
Compute on paper:
- The estimated mean height .
- The estimated sample variance and standard deviation .
Practice 2
Using the table from Practice 1:
- State the modal class.
- Estimate the median height using linear interpolation.
Worked Solutions for Practice Problems
Solution to Practice 1
- Midpoints: .
- Calculation Table:
| Interval |
Midpoint () |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Total |
— |
|
|
|
- Mean:
- Correction Term and Variance:
Solution to Practice 2
- Modal Class: The highest frequency is , in class .
- Median Interpolation:
- .
- Cumulative frequencies: , .
- Median falls in class ().
Test yourself
In a grouped frequency table, why do we use class midpoints to calculate the mean?
- Because the midpoint is always the exact average of every class
- Because individual raw data values within intervals are unknown, and midpoints serve as representative values
- Because midpoints eliminate the need to know the frequencies
- Because standard deviation is only defined for integer midpoints
For a class interval with midpoint and frequency , what is the value of ?
A grouped dataset of items has and . What is the sample variance ?