PickMyTest

Degrees of Freedom

What degrees of freedom mean and why they matter for statistical tests

Degrees of Freedom#

Degrees of freedom (df) indicate how many values in a calculation are free to vary. They determine the shape of the distribution used to calculate the p-value.

The Core Idea#

Imagine you have three numbers whose mean must be 10. You can freely choose the first two β€” for example, 8 and 12. The third number is then fixed (it must be 10 for the mean to work out).

You therefore have 2 degrees of freedom (df = n - 1 = 3 - 1 = 2).

Intuitive example

Five numbers must have a mean of 20:

  • You choose: 15, 22, 18, 25 β€” four numbers freely chosen
  • The fifth number must be 20 (since 15 + 22 + 18 + 25 + x = 100, so x = 20)

Degrees of freedom: df = 5 - 1 = 4

Why Are Degrees of Freedom "Used Up"?#

Every estimated parameter from the data "uses up" a degree of freedom. When you calculate the mean from your sample, you impose a constraint: the sum of values is fixed. That is why you lose one degree of freedom.

This is also why the sample variance is divided by n - 1 (not n):

s2=βˆ‘i=1n(xiβˆ’xΛ‰)2nβˆ’1s^2 = \frac{\sum_{i=1}^{n}(x_i - \bar{x})^2}{n - 1}

Dividing by n - 1 instead of n corrects the systematic underestimation of the population variance (Bessel's correction).

Degrees of Freedom for Different Tests#

Independent Samples t-Test#

df=n1+n2βˆ’2df = n_1 + n_2 - 2

Two means are estimated, so 2 degrees of freedom are used up.

Example

Group 1: n₁ = 25, Group 2: nβ‚‚ = 30

df = 25 + 30 - 2 = 53

Welch's t-Test#

In Welch's t-test, degrees of freedom are calculated using the Satterthwaite approximation and are typically not whole numbers:

df=(s12n1+s22n2)2(s12/n1)2n1βˆ’1+(s22/n2)2n2βˆ’1df = \frac{\left(\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}\right)^2}{\frac{(s_1^2/n_1)^2}{n_1 - 1} + \frac{(s_2^2/n_2)^2}{n_2 - 1}}

Paired t-Test#

df=nβˆ’1df = n - 1

where n is the number of pairs.

One-Way ANOVA#

Two different degrees of freedom:

  • Between groups: dfbetween=kβˆ’1df_{\text{between}} = k - 1 (k = number of groups)
  • Within groups: dfwithin=Nβˆ’kdf_{\text{within}} = N - k (N = total sample size)

Example: ANOVA with 3 groups

3 groups with n = 20 each (N = 60):

  • df_between = 3 - 1 = 2
  • df_within = 60 - 3 = 57
  • Reported as: F(2, 57)

Chi-Square Test#

df=(rβˆ’1)Γ—(cβˆ’1)df = (r - 1) \times (c - 1)

where r is the number of rows and c is the number of columns.

Example: 3Γ—2 contingency table

3 rows Γ— 2 columns:

df = (3 - 1) Γ— (2 - 1) = 2 Γ— 1 = 2

Multiple Regression#

  • Regression model: dfregression=pdf_{\text{regression}} = p (p = number of predictors)
  • Residuals: dfresiduals=nβˆ’pβˆ’1df_{\text{residuals}} = n - p - 1

Degrees of Freedom and Distribution Shape#

Degrees of freedom determine the shape of the reference distribution:

t-distribution: With few degrees of freedom, the t-distribution has heavier tails than the normal distribution. As df increases, it approaches the normal distribution. Beyond df β‰ˆ 30, the differences are minimal.

F-distribution: Defined by two df values (numerator and denominator). The shape changes depending on the combination.

Chi-square distribution: The mean of the distribution equals the degrees of freedom. With increasing df, it becomes more symmetric.

Practical Importance#

Degrees of freedom affect the critical value at which a result becomes significant:

dfCritical t-value (Ξ± = 0.05, two-tailed)
52.571
102.228
302.042
1001.984
∞1.960

With few degrees of freedom, the t-value must be larger to reach significance. This is because small samples carry more uncertainty.

Reporting Correctly#

Degrees of freedom are always reported alongside the test statistic:

  • t-test: t(53) = 2.31, p = .025
  • ANOVA: F(2, 57) = 4.12, p = .021
  • Chi-square: χ²(2) = 8.45, p = .015

Common Misconceptions#

"Degrees of freedom are just a technical detail." No. They directly determine the p-value. Incorrect degrees of freedom lead to incorrect conclusions.

"More degrees of freedom are always better." More df means more information, which is generally good. However, unnecessarily many parameters (and thus consumed df) can overfit a model.

"Degrees of freedom equal the sample size." Almost, but not quite. They equal the sample size minus the number of estimated parameters. In a t-test with n = 20 per group, df = 38, not df = 40.

Further Reading

  • Field, A. (2018). Discovering Statistics Using IBM SPSS Statistics (5th ed.). SAGE.
  • Bortz, J. & Schuster, C. (2010). Statistik fΓΌr Human- und Sozialwissenschaftler (7th ed.). Springer.