standarddeviationcalculator.net

Updated Free · runs in your browser

Statistics

Grouped data standard deviation calculator

Enter each class midpoint with its frequency. If your data is a frequency table of individual values rather than intervals, enter the values themselves as the midpoints — the arithmetic is identical and the result is then exact rather than an estimate.

Midpoint (x)Frequency (f)Remove

For class intervals such as 10–19, enter the midpoint (14.5). Frequency is how many observations fall in that class.

Treat the data as

The formula

x̄ = Σfx / Σf Sample: s = √[ Σf(x − x̄)² / (Σf − 1) ] Population: σ = √[ Σf(x − x̄)² / Σf ]

Every term is the ordinary standard deviation formula with a frequency multiplier attached. A class with a frequency of 12 contributes its squared deviation twelve times over, and n becomes the total frequency Σf rather than the number of rows.

A worked example

Test scores recorded as a grouped frequency table:

ClassMidpoint xffx
0–94.5313.5
10–1914.57101.5
20–2924.512294.0
30–3934.56207.0
40–4944.5289.0
Total—30705.0

The mean is 705 ÷ 30 = 23.5. Each class then contributes f(x − 23.5)²: 3(19)² = 1083, 7(9)² = 567, 12(1)² = 12, 6(11)² = 726 and 2(21)² = 882. Those total Σf(x − x̄)² = 3270. As a sample the variance is 3270 ÷ 29 = 112.759 and the standard deviation is 10.6188; as a population it is 3270 ÷ 30 = 109, giving 10.4403. Those figures are loaded into the calculator above.

The step-deviation (assumed mean) method

Many textbooks, including school curricula in India, teach a shortcut for doing this by hand. Pick an assumed mean A — usually a midpoint near the middle — and divide each deviation by the class width h, so the arithmetic runs on small whole numbers instead of decimals:

d′ = (x − A) ÷ h x̄ = A + h × Σfd′ ÷ N σ = h × √[ Σfd′² ÷ N − (Σfd′ ÷ N)² ]

For the table above, with A = 24.5 and h = 10:

xfd′fd′fd′²
4.53−2−612
14.57−1−77
24.512000
34.56166
44.52248
Total30—−333

The mean is 24.5 + 10 × (−3 ÷ 30) = 23.5, and σ = 10 × √(33 ÷ 30 − (−3 ÷ 30)²) = 10 × √1.09 = 10.4403 — exactly the population figure from the direct method. The formula gives the population standard deviation; multiply by √(N ÷ (N − 1)) for the sample version, 10.4403 × √(30 ÷ 29) = 10.6188. The method only saves effort when every class has the same width; the calculator and the direct method work for any table.

Getting the midpoints right

Most errors on grouped data come from the midpoints rather than the arithmetic. Worksheet 3 has grouped-data problems to practise on, with worked answers.

Class as writtenReadingMidpoint
10–19Discrete, gap to next class14.5
10–20, 20–30Continuous, upper bound excluded15, 25
10 ≤ x < 20Explicit, unambiguous15
Under 10Open-ended — see belowassume a bound

Open-ended classes such as "under 10" or "60 and over" have no midpoint. The usual workaround is to give them the same width as the neighbouring class and take the midpoint of that, but this is a guess, and the standard deviation is sensitive to it because the invented midpoint sits far from the mean and is then squared. Say so if you do it.

How far off is a grouped estimate?

Placing every observation at its class midpoint deletes all the variation inside each class, which pushes the standard deviation down. The effect is small when classes are narrow relative to the overall spread, and grows as they widen.

Sheppard's correction subtracts h²/12 from the variance, with h the class width, to compensate for the discarded within-class spread. It assumes a smooth distribution and classes of equal width, and it is not standard practice in most courses. If you have the raw data, use the ordinary calculator — grouping is a compromise for when the original values are genuinely unavailable, not something to do by choice.

Grouped data standard deviation: the worked example on this page, with its result and chart
Grouped data standard deviation: the worked example above, at a glance.

Common questions

How do I find the midpoint of a class interval?

Add the lower and upper boundaries and halve. For 10–19 that is (10 + 19)/2 = 14.5. For a continuous class written 10–20 where 20 belongs to the next class, use (10 + 20)/2 = 15.

Be consistent about which convention the data uses, because mixing them shifts every midpoint by half a unit and quietly biases the mean.

Why is grouped data only an estimate?

Because the raw values are gone. The method assumes every observation in a class sits exactly at the midpoint, when in reality they are spread across the interval. That assumption removes the within-class variation, so a grouped standard deviation typically comes out slightly smaller than the true one.

Sheppard's correction — subtracting h²/12 from the variance, where h is the class width — partially compensates. It is rarely applied in practice and this calculator does not apply it.

What is n for grouped data?

The total frequency, Σf — not the number of rows. A table with 5 classes and frequencies 3, 7, 12, 6, 2 has n = 30, so a sample calculation divides by 29.

Do I use n or n − 1 for grouped data?

The same rule as for raw data: Σf − 1 if the data is a sample, Σf if it is the whole population. Textbook exercises frequently use the population form without saying so, which is a common source of small discrepancies against a printed answer.