Memra

Variance and standard deviation

◈ 6 cards

The sums table, the deviation form and the shortcut form of s², why the divisor is n − 1, and the tool that divides by n instead.

Spread, in the units of the data

Two branches can share a mean and behave completely differently. The variance measures how far values sit from the mean, on average and squared; the standard deviation takes the square root so the answer is back in the data's units.

The shortcut form avoids computing every deviation:

It needs only two sums — and — and those two sums are the sums-table habit that Module 4 (covariance, the slope) and Module 13 reuse. Build the table once and every later formula reads from it.

Worked example — Bramble & Voss audit hours

A Guelph audit practice, Bramble & Voss, logged its monthly audit-hour totals for six months: 42, 38, 51, 45, 39, 49.

The sums. , , . .

Shortcut. , so hours.

Deviation table, as a check. The deviations are −2, −6, 7, 1, −5, 5 (they sum to 0, as they must); squared, 4, 36, 49, 1, 25, 25, which total 140. Same numerator, same 28. When the two disagree, the arithmetic is wrong somewhere — usually a squared deviation.

Read it: a typical month is about 5.3 hours from the 44-hour mean.

Why n − 1

The deviations are not six free numbers. Because was computed from the same data, they are forced to sum to zero — once five are known, the sixth is fixed. Only of them carry independent information, and that is the degrees of freedom the divisor counts. The second justification is the one Module 8 will make precise: dividing by produces a variance that is too small on average — the sample's values are closer to their own mean than to the population mean — and corrects the bias exactly.

Every tool in this course agrees: statistics.stdev, R's sd() and var(), and the cheat sheet all divide by . The one that does not is statistics.pstdev (and numpy's default std), which divides by and is for a population — the whole set of units, not a sample of them. On the audit hours it prints 4.83 where 5.29 is expected; a 4.83 on the paper is this mistake and loses the mark.

A second run, by deviations

Five values: 10, 12, 15, 11, 17. . Deviations −3, −1, 2, −2, 4; squared 9, 1, 4, 4, 16; total 34. , . The shortcut gives the same: , .

xx − x̄(x − x̄)²42−241,76438−6361,444517492,60145112,02539−5251,521495252,401Σ = 264014011,756x̄ = 264/6 = 44. Deviations sum to 0 — the check that costs nothing.
The sums table. The deviation form uses the third column (Σ = 140); the shortcut uses the fourth (Σx² = 11,756) with Σx = 264. Both give s² = 140/5 = 28.
NORMAL ~/memra/learn/afm-113/variance-and-standard-deviation utf-8 LF