Standard Deviation for Grouped Data: Three Methods Explained
Choose the direct, shortcut or step-deviation method for grouped data, with one fully solved example, common mistakes and practice answers.
- 11th
- Economics
You know how to calculate a mean. Then a question asks for standard deviation, and suddenly your table needs several extra columns. Should you square the midpoints? Subtract an assumed mean? Divide by the class width first?
Here is the reassuring part: direct, shortcut and step-deviation methods calculate the same standard deviation. You choose between them to make the arithmetic easier, unless the question specifies a method.
We will solve one original grouped-data question three ways. By the end, you should be able to look at a frequency table, choose a sensible approach and catch the errors that change an otherwise good answer.
What does standard deviation tell you?
Imagine two shops whose orders both take an average of 30 minutes to prepare. At one shop, most orders are ready close to that time. At the other, some are ready very quickly and others take much longer.
The average alone hides that difference. Standard deviation measures spread around the mean. A smaller value indicates less dispersion, while a larger value indicates more dispersion, when comparing the same kind of measurement in the same units.
The calculation uses squared deviations from the mean, averages them and takes a square root. That is why standard deviation is not simply the average absolute distance from the mean. That other calculation gives mean deviation.
If the observations are measured in minutes, variance is measured in minutes squared and standard deviation is measured in minutes.
OpenStax’s explanation of spread discusses both this grouped-data limitation and the distinction between population and sample standard deviation.
Know your symbols before choosing a formula
We will use the following notation throughout:
- x: the class midpoint, found by adding the lower and upper class limits and dividing by 2.
- f: the ordinary frequency of that class.
- N: the total frequency, so N = sum of f.
- m: the arithmetic mean of the midpoint distribution.
- A: a convenient assumed mean.
- d: the deviation x - A.
- h: one positive scale factor used for every row.
- u: the coded deviation (x - A)/h.
Here, “sum” means add the relevant column. For example, sum(fx) means multiply each midpoint by its frequency, then add those products. The usual mathematical symbol for this operation is capital sigma, Σ.
All worked questions below use the descriptive standard deviation with divisor N. If a question explicitly asks for sample standard deviation as an estimate of a population’s spread, its formula uses N - 1 instead. Follow the question’s convention; do not change the denominator halfway through a solution.
The midpoint and variance formulas follow NCERT’s Statistics chapter, Sections 13.5.2 to 13.5.4. The datasets and worked calculations in this guide are original.
Which method should you choose?
| What you notice | A useful choice | Columns to prepare |
|---|---|---|
| The actual mean is easy to work with | Direct deviations from the mean | x, f, fx, x - m, f(x - m)² |
| Values become small after subtracting a central number | Assumed-mean shortcut | x, f, d, fd, fd² |
| Deviations share a convenient factor | Step deviation | x, f, u, fu, fu² |
Some textbooks use “direct method” for the raw-square formula involving sum(fx²), and “shortcut” for a coded method. Look at the formula and define your columns clearly rather than relying only on the method’s name. We will also check the raw-square formula below.
Our main example: order preparation times
A shop records preparation times for 40 orders. The classes are exclusive: 10 to 20 means at least 10 minutes but less than 20 minutes.
| Time in minutes | Frequency, f | Midpoint, x | fx |
|---|---|---|---|
| 10 to 20 | 4 | 15 | 60 |
| 20 to 30 | 8 | 25 | 200 |
| 30 to 40 | 12 | 35 | 420 |
| 40 to 50 | 10 | 45 | 450 |
| 50 to 60 | 6 | 55 | 330 |
| Total | 40 | 1,460 |
The estimated mean is:
m = sum(fx)/N = 1,460/40 = 36.5 minutes.
Notice that N is 40, not 5. There are five classes, but those classes contain 40 observations.
Also notice why we need frequencies. The midpoint 35 represents 12 orders, while the midpoint 15 represents only four. Treating each midpoint as one observation would answer a different question.
Method 1: direct deviations from the actual mean
The direct route follows the definition:
Variance = sum[f(x - m)²]/N
Standard deviation = square root of variance
For each row, subtract 36.5 from the midpoint, square that deviation and then multiply by the frequency.
| x | f | x - 36.5 | (x - 36.5)² | f(x - 36.5)² |
|---|---|---|---|---|
| 15 | 4 | -21.5 | 462.25 | 1,849.00 |
| 25 | 8 | -11.5 | 132.25 | 1,058.00 |
| 35 | 12 | -1.5 | 2.25 | 27.00 |
| 45 | 10 | 8.5 | 72.25 | 722.50 |
| 55 | 6 | 18.5 | 342.25 | 2,053.50 |
| Total | 40 | 5,710.00 |
Therefore:
Variance = 5,710/40 = 142.75 minutes squared.
Standard deviation = square root of 142.75 = 11.95 minutes, rounded to two decimal places.
The grouped observations have a mean of 36.5 minutes and an estimated standard deviation of about 11.95 minutes. This does not mean every order is exactly 11.95 minutes away from the mean, or that a fixed percentage lies within that distance. We would need further information about the distribution to make that percentage claim.
A quick check on the mean
Before squaring, the frequency-weighted deviations from the actual mean should total zero:
4(-21.5) + 8(-11.5) + 12(-1.5) + 10(8.5) + 6(18.5)
= -86 - 92 - 18 + 85 + 111 = 0.
This check can uncover a copied midpoint or mean error. It works with the actual mean, not necessarily with an assumed mean.
Method 2: the assumed-mean shortcut
The direct method is clear, but all those decimals make the table slower to complete. Let us choose A = 35 and define d = x - 35.
The formula becomes:
Variance = sum(fd²)/N - [sum(fd)/N]²
Take the square root of the entire result to obtain standard deviation.
| x | f | d = x - 35 | fd | fd² |
|---|---|---|---|---|
| 15 | 4 | -20 | -80 | 1,600 |
| 25 | 8 | -10 | -80 | 800 |
| 35 | 12 | 0 | 0 | 0 |
| 45 | 10 | 10 | 100 | 1,000 |
| 55 | 6 | 20 | 120 | 2,400 |
| Total | 40 | 60 | 5,800 |
Substitute carefully:
Variance = 5,800/40 - (60/40)²
= 145 - 1.5²
= 145 - 2.25
= 142.75 minutes squared.
Standard deviation = square root of 142.75 = 11.95 minutes.
We can recover the mean too:
m = A + sum(fd)/N = 35 + 60/40 = 36.5 minutes.
Why do we subtract the correction term?
Our temporary centre was 35, but the actual mean is 36.5. Squared distances from 35 include the effect of using a centre that is 1.5 minutes away from the mean.
The correction removes that extra squared distance:
Average squared distance from A = variance + (m - A)².
Here, 145 = 142.75 + 2.25.
If you stop at 5,800/40, you have calculated average squared distance from the assumed mean, not variance about the actual mean.
For the first row, the correct calculation is 4 × (-20)² = 1,600. The incorrect calculation (-80)² gives 6,400.
Method 3: step deviation
Our deviations are all multiples of 10. Set A = 35, h = 10 and u = (x - 35)/10.
Now the working numbers become -2, -1, 0, 1 and 2.
Variance = h² × {sum(fu²)/N - [sum(fu)/N]²}
Standard deviation = h × square root of {sum(fu²)/N - [sum(fu)/N]²}
| x | f | u | fu | fu² |
|---|---|---|---|---|
| 15 | 4 | -2 | -8 | 16 |
| 25 | 8 | -1 | -8 | 8 |
| 35 | 12 | 0 | 0 | 0 |
| 45 | 10 | 1 | 10 | 10 |
| 55 | 6 | 2 | 12 | 24 |
| Total | 40 | 6 | 58 |
First calculate the variance of the coded values:
58/40 - (6/40)² = 1.45 - 0.0225 = 1.4275.
Then return to the original scale:
Variance = 10² × 1.4275 = 142.75 minutes squared.
Standard deviation = 10 × square root of 1.4275 = 11.95 minutes.
The mean is:
m = A + h × sum(fu)/N
= 35 + 10 × 6/40
= 36.5 minutes.
Why does h return, but A does not?
Subtracting 35 moves every midpoint by the same amount. It does not change the distances between observations or their distances from the shifted mean.
Dividing by 10 does change distances: it makes them one-tenth as large. So the standard deviation of u is one-tenth of the standard deviation of x. Multiplying by 10 restores the original units.
For variance, the factor is 10² because the distances were squared.
A fourth check: the raw-square formula
You may also see:
Variance = sum(fx²)/N - [sum(fx)/N]²
It is the assumed-mean expression with A = 0, so d = x.
For our original table, the fx² values are 900, 5,000, 14,700, 20,250 and 18,150. Their total is 59,000.
Variance = 59,000/40 - 36.5²
= 1,475 - 1,332.25
= 142.75.
This formula is useful if sum(fx) and sum(fx²) are already supplied. For large midpoints close together, subtracting an assumed mean usually produces smaller, friendlier numbers.
You do not need to solve every exam question four times. We have done it here to show that the methods agree and to give you a way to check practice answers.
Can you use step deviation with unequal class widths?
Yes, provided h is the same nonzero scale factor for every row. We choose it positive here. Equal class widths often make coding convenient, but they are not a mathematical requirement of the transformation x = A + hu.
Consider a separate, original distribution:
| Class interval | f | Midpoint, x | u = (x - 20)/5 | fu | fu² |
|---|---|---|---|---|---|
| 0 to 10 | 4 | 5 | -3 | -12 | 36 |
| 10 to 30 | 8 | 20 | 0 | 0 | 0 |
| 30 to 60 | 8 | 45 | 5 | 40 | 200 |
| Total | 20 | 28 | 236 |
Here, A = 20 and h = 5. The widths are 10, 20 and 30, but every deviation is divided by 5.
Mean = 20 + 5 × 28/20 = 27.
Variance = 25 × [236/20 - (28/20)²]
= 25 × (11.8 - 1.96)
= 246.
Standard deviation = square root of 246 = 15.68, approximately.
The direct calculation confirms it:
[4(5 - 27)² + 8(20 - 27)² + 8(45 - 27)²]/20
= (1,936 + 392 + 2,592)/20 = 246.
Do not divide each row by its own class width. That creates different transformations in different rows, so a single multiplier cannot restore the original spread.
Also, use the actual frequencies here. Frequency density helps draw histograms with unequal widths; it does not replace the number of observations in this weighted calculation.
Prepare awkward tables before calculating
Inclusive classes
For classes such as 10 to 19, 20 to 29 and 30 to 39, the midpoints are 14.5, 24.5 and 34.5.
For measurements recorded to the nearest unit, the corresponding boundaries are 9.5 to 19.5, 19.5 to 29.5 and 29.5 to 39.5. The midpoints remain unchanged.
Do not turn a midpoint of 14.5 into 15 just because the latter is easier to multiply.
Cumulative frequencies
Recover ordinary frequencies before starting. If the less-than cumulative frequencies are 4, 12, 24, 34 and 40, the ordinary frequencies are:
4, 12 - 4, 24 - 12, 34 - 24 and 40 - 34
= 4, 8, 12, 10 and 6.
Those are exactly the frequencies in our main example. Using cumulative frequencies as f would count observations repeatedly.
Open-ended classes
A class such as “60 and above” does not supply an upper endpoint, so its midpoint cannot be determined from the table alone. You need more information or an explicitly stated assumption before applying the midpoint method to that class.
Exact values with frequencies
If a table gives exact values such as 2, 4 and 7, use those values directly as x. Do not manufacture class intervals or midpoints. The frequency-weighted formulas still work.
Seven mistakes worth catching before submission
- Using the number of rows as N. Add the frequencies instead.
- Ignoring f. A midpoint representing 12 observations must contribute 12 times.
- Squaring fd or fu. The columns are f × d² and f × u².
- Dropping negative signs too early. Keep signs in fd and fu. Their squared counterparts are nonnegative.
- Omitting the correction term. An assumed mean need not equal the actual mean.
- Forgetting the final square root or scale factor. Name variance and standard deviation separately.
- Rounding intermediate values. Retain exact fractions or full working precision until the final answer.
A negative variance is a warning to recheck the calculation. With nonnegative frequencies and positive total frequency, variance cannot be negative. In hand calculations, inspect column totals, brackets and the correction term first.
For a broader comparison of measures, read our guide to range, quartile deviation, mean deviation and standard deviation.
Try these practice questions
1. Choose a method
The midpoints are 105, 115, 125, 135 and 145. Which coding would keep the working small?
Answer: Step deviation with A = 125 and h = 10 gives u = -2, -1, 0, 1 and 2. The frequencies still need to be included when you form fu and fu².
2. Calculate a complete answer
For the classes 0 to 10, 10 to 20 and 20 to 30, the frequencies are 2, 4 and 2. Find the mean, variance and standard deviation using divisor N.
Answer: Midpoints are 5, 15 and 25, and N = 8. Mean = 15. The weighted squared deviations total 2(100) + 4(0) + 2(100) = 400. Variance = 400/8 = 50. Standard deviation = square root of 50, approximately 7.07.
3. Repair a shortcut answer
A student has N = 50, sum(fd) = -100 and sum(fd²) = 2,000. They write variance = 2,000/50 = 40. What is missing?
Answer: Subtract the correction: (-100/50)² = 4. Variance = 40 - 4 = 36, so standard deviation = 6. The negative column total is valid; its square is positive.
4. Restore the original units
The variance of coded values u is 2.25, where u = (x - 100)/4. Find the standard deviation of x.
Answer: The standard deviation of u is 1.5. Multiply by 4 to get 6. The variance of x is 16 × 2.25 = 36. Do not add 100 to either measure of dispersion.
5. Read the square correctly
A row has f = 7 and u = -3. Find fu and fu².
Answer: fu = -21, while fu² = 7 × 9 = 63. The value 441 would be (fu)², which is a different expression.
6. Interpret the result
Two sets of delivery times, recorded in minutes, have the same mean. Their standard deviations are 4 and 9 minutes. Which has less dispersion?
Answer: The set with standard deviation 4 minutes has less dispersion around its mean. This does not tell you that every delivery was faster, nor does it prove a particular cause for the difference.
Your final answer checklist
Before you put down your pen, check that your midpoint column is correct, N equals the total frequency, and your chosen A and h are stated wherever you use them. Show the column totals and substitute them into the formula with brackets intact.
Finally, distinguish the two results: variance has squared units; standard deviation has the original units. For the main example, those results are 142.75 minutes squared and approximately 11.95 minutes.
Frequently asked questions
What is the formula for standard deviation of grouped data?
Using class midpoints x, frequencies f, total frequency N and mean m, it is the square root of sum[f(x - m)²]/N. This guide uses the descriptive formula with divisor N.
Which method is fastest?
Step deviation is often quickest when subtracting an assumed mean and dividing by one common factor produces small integers. If the actual mean or raw-square totals are already convenient, another method may take less work. Use a specified method when the question requests one.
Do all three methods give the same answer?
Yes. They are algebraically equivalent for the same midpoint distribution and denominator convention. Differences beyond rounding usually indicate a calculation or substitution error.
Can the assumed mean be any number?
Yes. A convenient value near the centre usually reduces arithmetic. It does not have to equal the true mean or be the midpoint of the highest-frequency class.
Must h always equal the class width?
No. It must be one common nonzero scale factor for all rows. A positive h equal to the common class width is often convenient. Unequal class widths do not prevent coding with a single suitable factor.
Why is there no A in the final standard deviation formula?
Subtracting a constant shifts the observations and their mean equally, leaving deviations from the mean unchanged. Scaling changes those distances, which is why h must be restored.
Is standard deviation from class intervals exact?
It is exact for the distribution in which every observation is represented by its class midpoint. It is generally an estimate for the original observations, because their individual positions within the intervals are unknown.
Should I divide by N or N - 1?
Use N for the descriptive calculation used here. Use N - 1 when the question calls for sample standard deviation under that convention. Grouping the data does not, by itself, determine which denominator is appropriate.
Can standard deviation be zero?
Yes, if every represented observation with positive frequency has the same value. If all observations fall in one interval, the midpoint calculation gives zero, even though the original observations could differ within that interval.
How many decimal places should I use?
Follow any rounding instruction in the question. Otherwise, two decimal places is a reasonable presentation choice for these examples. Keep unrounded values during the calculation and round only the final result.
Looking for commerce tuitions?
Prachi is a gold-medalist commerce teacher with experience at Deloitte and KPMG. She focuses on fundamentals to build a strong foundation.