Grouped Data Standard Deviation Calculator

Grouped Data Standard Deviation Calculator

Estimate the mean, standard deviation, variance and median from a frequency table, when all you know is how many values fall in each class.

s = √(Σf(m − x̄)² ÷ (Σf − 1)), m = class midpoint

Lower limit, upper limit, then frequency. List the classes in order.

Enter your frequency table to estimate its standard deviation

What is Grouped Data Standard Deviation?

It's an estimate of the standard deviation made from a frequency table rather than from the raw values. Once data is grouped ("12 deliveries between 30 and 40 km"), the individual values are gone, so every value in a class is treated as if it sat at the class midpoint.

The mean and standard deviation are then worked out as usual, with each midpoint counted as many times as its frequency. If the values inside each class are spread fairly evenly, the estimates come out close to the real thing. If they bunch at one end of a class, the estimates drift.

The median is estimated differently: find the class that holds the middle value, then assume its values are spread evenly across the class and read off where the middle one would fall.

Grouped Mean, Variance and Median Formulas

Midpoint method as taught in OpenStax Introductory Statistics. See Sources.

1. Midpoints and the estimated mean

m = (lower + upper) ÷ 2 · n = Σf
x̄ = Σfm ÷ n

2. Variance and standard deviation

s² = Σf(m − x̄)² ÷ (n − 1) · σ² = Σf(m − x̄)² ÷ n
s = √s²

3. Estimated median

median ≈ L + ((n ÷ 2 − CF) ÷ f) × w

L is the lower limit of the class holding the middle value, CF the cumulative frequency before it, f its frequency and w its width.

Worked Example: 40 Delivery Distances

Given:
Distances in km: 10–20 (5), 20–30 (8), 30–40 (12), 40–50 (10), 50–60 (5).
Step 1:
Mean from the midpoints:
Σfm = 75 + 200 + 420 + 450 + 275 = 1,420 → 1,420 ÷ 40 = 35.5 km
Step 2:
Weighted squared deviations:
2,101.25 + 882 + 3 + 902.5 + 1,901.25 = 5,790 → s = √(5,790 ÷ 39) = 12.18
Step 3:
Median (the 20th value falls in 30–40):
30 + ((20 − 13) ÷ 12) × 10 = 35.83 km
Result:
SD ≈ 12.2 km around a mean of 35.5 km

The mean and median are close, which fits the nearly symmetric table. Roughly two-thirds of deliveries would be expected within 23 to 48 km.

The Full Working for the Deliveries

The column layout most textbooks use. Add the fm column for the mean and the last column for the sum of squares.

Midpoints and products for the example frequency table
Classfmfmf(m − x̄)²
10–20515752,101.25
20–30825200882
30–4012354203
40–501045450902.5
50–605552751,901.25

Common Grouped Data Mistakes

  • Using class limits instead of midpoints. Each class is represented by its midpoint, not its lower or upper limit.
  • Dividing by the number of classes. n is the total frequency (40 above), not the number of rows (5).
  • Forgetting to multiply by f. Both the mean and the sum of squares need each midpoint counted f times.
  • Picking the wrong median class. Find where the cumulative frequency first reaches n ÷ 2, not the class with the biggest frequency.
  • Treating the answer as exact. Grouped results are estimates, because the values inside each class are unknown.

Grouped Data Standard Deviation FAQs

What about open-ended classes like “60+”?

They have no midpoint. Close them with a sensible upper limit based on what you know, and note that the estimate depends on that choice.

Do the classes need to be the same width?

No. The midpoint method works with unequal widths. Only histograms need extra care, because bar areas must reflect the widths.

What is Sheppard’s correction?

An adjustment that subtracts w² ÷ 12 from the grouped variance to allow for grouping. It suits equal-width classes and smooth, bell-shaped data, and is rarely used in introductory courses.

Why does my answer differ from the raw-data SD?

Grouping replaces each value with its class midpoint. The difference is the information lost by grouping.

What if my classes are written 10–19, 20–29?

Those are discrete classes with a gap. The true boundaries are 9.5–19.5, 19.5–29.5 and so on; the midpoints (14.5, 24.5) come out the same either way.

Should I use n or n − 1?

Use n − 1 if the table summarises a sample and you want to estimate the wider population’s spread, which is the usual case. Use n for a complete population.

How do I estimate the mode from grouped data?

The modal class is the one with the highest frequency. A finer estimate is L + (d₁ ÷ (d₁ + d₂)) × w, where d₁ and d₂ are the differences in frequency from the neighbouring classes.

Can I enter a frequency of zero?

Yes. Empty classes are allowed and simply contribute nothing, though the total frequency must be at least 2.

Sources

  • OpenStax, Introductory Statistics 2e, section 2.7: standard deviation of grouped frequency tables.
  • W. F. Sheppard, "On the calculation of the most probable values of frequency-constants", Proceedings of the London Mathematical Society 29 (1898) 353–380.

Related Tools