Why do you divide by n-1 for sample variance
We divide by n‑1 because the sample variance must be an unbiased estimator of the population variance; using n‑1 corrects the bias caused by estimating the mean from the same data. This adjustment is known as Bessel's correction.
Statistics · Descriptive statistics
When you calculate variance from a sample, you first compute the sample mean and then measure how each observation deviates from that mean. Those deviations are not independent of the data because the mean itself is a function of the same observations. As a result, the raw sum of squared deviations tends to underestimate the true variability of the underlying population.
Why the divisor is n‑1
The expectation of the sum of squared deviations equals , where is the population variance. Dividing by therefore yields an estimator whose expected value is exactly . If you divided by you would obtain , which is systematically too low. This bias disappears only as the sample size grows, but for small samples the correction is essential.
Key reasons for using n‑1:
- Ensures unbiasedness of the variance estimator
- Accounts for the loss of one degree of freedom when estimating the mean
- Provides a more accurate estimate of population spread, especially for small n
Deriving the unbiased divisor:
- 1Write the sample variance with a generic divisor d:
- 2Take expectations:
- 3Set and solve for d, giving d = n‑1
Worked example with real numbers:
| Step | Value |
|---|---|
| Data | 2, 4, 6, 8 |
| Mean | 5 |
| Sum of squared deviations | 20 |
| Divisor n‑1 (3) | 3 |
| Sample variance | 6.667 |
If you mistakenly divide the same sum of squares by you obtain for the example above, which underestimates the true population variance. The bias becomes larger as the sample size shrinks; with the difference between dividing by 2 and by 1 is a factor of two. Remember that Bessel's correction restores unbiasedness by acknowledging the one lost degree of freedom.
Check yourself
What divisor makes the sample variance an unbiased estimator of the population variance?
Get this as a lesson built for you
Describe what you are studying and Lernex writes the lesson and the questions around it. Free, and it takes about a minute.
Try itNo account needed to try it.
What people ask next
- Why does the population variance use n as the divisor?Ask
- What are degrees of freedom and how do they relate to variance?Ask
- How does Bessel's correction affect standard deviation?Ask
- when should you use the median instead of the mean
- how do you tell if a distribution is skewed left or right
- what is the difference between standard deviation and standard error
- what does a p-value actually mean
