Sample variance
Sample variance divides the sum of squared gaps by n minus 1, not n. This corrects for the fact that a sample sits closer to its own mean than to the true population mean.
Last updated
Analogy
A sample is a photo of a crowd. The photo makes the crowd look slightly more alike than it is, so we nudge the estimate upward.
Example
Sample: 2, 4, 6Mean = 4Squared gaps: 4, 0, 4 (sum 8)Sample variance = 8 / 2 = 4Sample SD = 2(Dividing by 3 gives 2.67)
In practice
Whenever you estimate spread from a sample, which is almost always, you use n minus 1.
Practice
Flashcards
- Why use n minus 1 in sample variance?It corrects the bias from measuring spread around the sample mean.
Interview questions
- A sample is 2, 4, 6. Calculate the sample standard deviation and explain the n minus 1.
- Mean is 4
- Squared gaps sum to 8
- Variance 8 / 2 = 4
- SD is 2
- n minus 1 corrects bias
Questions people ask
Why do we divide by n minus 1 for a sample?
The sample mean is calculated from the same data, so values sit closer to it than to the true mean. Dividing by n would underestimate the true variance on average. Using n minus 1 removes that bias. The effect matters most for small samples.
What does n minus 1 mean in degrees of freedom?
Once the sample mean is known, only n minus 1 values are free to vary, because the last one must make the total match. Those free values are the degrees of freedom. With 3 values and a known mean, picking two fixes the third.