Skip to content

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 xˉ\bar{x} 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 (n1)σ2(n-1)\sigma^2, where σ2\sigma^2 is the population variance. Dividing by n1n-1 therefore yields an estimator s2s^2 whose expected value is exactly σ2\sigma^2. If you divided by nn you would obtain n1nσ2\frac{n-1}{n}\sigma^2, 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:

  1. 1Write the sample variance with a generic divisor d: sd2=1di=1n(xixˉ)2s_d^2 = \frac{1}{d}\sum_{i=1}^n (x_i-\bar{x})^2
  2. 2Take expectations: E[(xixˉ)2]=(n1)σ2E[\sum (x_i-\bar{x})^2] = (n-1)\sigma^2
  3. 3Set E[sd2]=σ2E[s_d^2] = \sigma^2 and solve for d, giving d = n‑1

Worked example with real numbers:

StepValue
Data2, 4, 6, 8
Mean xˉ\bar{x}5
Sum of squared deviations20
Divisor n‑1 (3)3
Sample variance s2s^26.667

If you mistakenly divide the same sum of squares by nn you obtain 55 for the example above, which underestimates the true population variance. The bias becomes larger as the sample size shrinks; with n=2n=2 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 it

No account needed to try it.

What people ask next