Variance and standard deviation
Two data sets can share the same mean and yet feel completely different — one tightly bunched, the other scattered wide. Range only looks at the two extremes, and mean deviation dodges the sign problem by taking absolute values, which is awkward to manipulate algebraically. Variance and standard deviation solve this more elegantly: square every deviation from the mean instead of taking its absolute value. Squaring kills the sign just as effectively, but the result behaves beautifully under algebra — sums of squares expand, factor and combine in ways absolute values never do, which is exactly why every later statistical idea (correlation, regression, the normal distribution) is built on variance rather than mean deviation. This section covers the definitions for ungrouped and grouped data, and the three computational routes — direct, short-cut (assumed-mean) and step-deviation — that all arrive at the same answer.
Variance is the mean of the squared deviations from the mean, , and standard deviation restores the original units; the short-cut and step-deviation methods compute the same with smaller numbers.
The core idea
Why squares, not absolute values. Mean deviation about the mean, , avoids the deviations cancelling to zero, but the modulus sign makes it hard to differentiate or combine algebraically. Squaring achieves the same cancellation-proofing while staying smooth and additive — this is the whole reason variance, not mean deviation, is the measure carried forward into every advanced statistical technique.
Definitions. For grouped data with values occurring with frequency and mean , variance is the average squared deviation:
where: are the data values (or class mid-points), are the corresponding frequencies, is the mean, and is the total number of observations. For ungrouped data every , giving . Standard deviation is the positive square root — it brings the "squared units" of variance (e.g. cm² for a height data set) back to the original units (cm), which is why it, not variance, is usually the number reported:
Three routes to the same number. The direct method applies the definition above as-is — fine when and the are small, tedious otherwise. The short-cut (assumed-mean) method picks a convenient value near the centre of the data, sets , and uses
which is algebraically identical to the direct formula but keeps the numbers small. The step-deviation method, for grouped data with equal class width , further scales so the become small integers:
where: is any assumed mean (a convenient reference value, usually a class mid-point), , is the common class width, and . All three formulas give the identical ; only the arithmetic load differs.
Worked example
The heights (in cm) of 50 plants are grouped as below. Find the standard deviation using the step-deviation method, with assumed mean and class width .
| Class | |||||
|---|---|---|---|---|---|
| 10–20 | 5 | 15 | 20 | ||
| 20–30 | 12 | 25 | 12 | ||
| 30–40 | 18 | 35 | 0 | ||
| 40–50 | 10 | 45 | 10 | ||
| 50–60 | 5 | 55 | 20 | ||
| Total | 50 | 62 |
Step 1. Read off the totals: , , .
Step 2. Apply the step-deviation formula: .
Step 3. Compute inside the root: and , so .
Step 4. The mean can be recovered from the same table as a check: cm, consistent with the assumed mean being close to centre. Standard deviation cm, so variance cm².
Common traps
- Reporting variance () when the question asks for standard deviation (), or vice versa — always check the units expected in the answer.
- Forgetting to multiply by at the end of the step-deviation formula, which silently gives a value that is too small.
- Squaring the whole fraction correctly, but then subtracting instead — these two expressions are not the same and give a different, wrong result.
- Choosing an assumed mean far from the data's centre, which makes or unnecessarily large and defeats the point of the short-cut and step-deviation methods.
Show algebraically that switching from the direct deviations to the assumed-mean deviations produces an identical value of , so the choice of never changes the answer — only the size of the numbers being handled changes, which is the entire justification for using a shortcut at all.
Step 1. Write , so . The mean satisfies , where , because averaging both sides of over the frequencies just adds to the average of .
Step 2. Substitute into the deviation from the mean: . So the deviation of from equals the deviation of from — shifting every value by the constant does not change how spread out they are.
Step 3. Square and average: . Expand the right-hand side: .
Step 4. Since , the middle term is , so the expression collapses to , which is exactly the short-cut formula. Since never appears in the final expression except inside , any choice of gives the same — only the arithmetic effort changes.
Ask the tutor: if your step-deviation answer does not match the direct-method answer, or you want a fresh grouped data set to practise all three methods on, ask the AI tutor to walk through it with you.
Why do we square the deviations instead of just adding the negative ones as positive?
Adding absolute values, , does avoid the deviations cancelling out, and that is exactly what mean deviation does. But absolute value is a "kinked" function — it has no clean derivative at zero and does not expand algebraically the way a square does. Squaring keeps everything smooth: can be expanded, summed, and combined with other squared quantities using ordinary algebra, which is precisely why variance underlies correlation, regression and the normal distribution later on, while mean deviation stays a comparatively minor measure.
Does it matter which value I choose for the assumed mean A?
Not for correctness — any value of gives exactly the same final standard deviation, as the derivation above shows algebraically. It matters only for convenience: picking far from the data's centre makes the or values large, which brings back the very arithmetic burden the short-cut method was meant to avoid. The usual choice is a value near the middle of the data, often the mid-point of the class with the highest frequency.
If I already have variance, how do I know when to also report standard deviation?
Report standard deviation whenever the answer needs to be in the same units as the original data — variance carries squared units (cm² for heights, marks² for scores), which are not directly interpretable, while standard deviation is back in cm or marks and can be compared directly to the data itself. Many exam questions ask for both: compute variance first as , then take its square root for , keeping enough decimal places before rounding so the final square root is accurate.