Why n − 1? (degrees of freedom, variance of a sample)
In brief
Degrees of freedom are the number of values that can still vary freely after something has been estimated from the data. With the mean from n values there are n − 1. Dividing the sum of squares by them gives the variance.
An example by hand
Four children, mean weight 20 kg. Three weights are 22, 25 and 19. The sum of all four must be 4 · 20 = 80, so the fourth child weighs 80 − 66 = 14 kg. It was no longer free: of four values only three are free, the degrees of freedom are 3.
Why divide by n − 1?
The sum of squared deviations from the mean here is 66. The mean comes from the same data and is closer to them than the true value of the population. So the deviations are too small on average. Dividing by n − 1 instead of n corrects exactly for this: the variance of the sample is an unbiased estimator of the variance of the population. Here: 66 : 3 = 22 instead of 66 : 4 = 16.5.
Counting degrees of freedom
- One mean (one-sample t test, paired t test with n pairs): n − 1.
- Two groups with equal variance (pooled t test): n₁ + n₂ − 2, because two means are estimated.
- In general: number of values minus number of quantities estimated from the data.
How it works in Statable
- Under "Learning" open the unit: "Work it out yourself", then "Slider".
- In the calculator "Calculate distributions" choose the t distribution and change the degrees of freedom: with few degrees of freedom it is wider than the normal distribution, with many almost the same.
What is often misunderstood
- Degrees of freedom are neither a sample size nor an effect. They say how much information is left to estimate the error.
- The standard deviation with n − 1 is not quite unbiased; only the variance is.
For specialists
E[Σ(xᵢ − x̄)²] = (n − 1)σ², so s² = SS : (n − 1) is unbiased for σ². The standard deviation s, as a root, is not an unbiased estimator of σ. The t distribution depends only on the degrees of freedom and approaches the standard normal distribution as they grow.
Sources
Bortz, J. & Schuster, C. Statistik für Human- und Sozialwissenschaftler, chapters 6 and 8.
Take away
- Estimating a mean from the data costs one degree of freedom.
- The variance of the sample is divided by n − 1 so that it does not underestimate the variance of the population.
- The pooled t test with two groups has n₁ + n₂ − 2 degrees of freedom.
- Few degrees of freedom make the t distribution wider than the normal distribution.