Degrees of freedom

Analytika TeamLast reviewed 6 min read

Degrees of freedom appear in brackets after almost every test statistic, and confuse almost everyone. The idea is simpler than it sounds, and you rarely have to calculate df yourself. But knowing where they come from helps you spot errors and report results correctly.

An intuitive explanation

Suppose three numbers must have a mean of 10. You can pick the first two freely, say 7 and 12, but then the third is forced to be 11. Only two of the three values were free to vary. Once you’ve used the data to estimate one thing (the mean), you have n − 1 = 2 degrees of freedom left.

That’s why the sample variance divides by n − 1: the deviations from the sample mean must sum to zero, so only n − 1 of them carry independent information. In general, every parameter you estimate costs one degree of freedom.

Why df matter

The t, F and chi-square distributions change shape with their degrees of freedom. With few df, the t-distribution has heavier tails, so you need a larger t to reach significance. With 5 df the 95% critical value is 2.571. With 100 df it’s 1.984 (see the t-distribution). The same t statistic can therefore give quite different p-values depending on df.

Degrees of freedom for common tests

TestdfReal example
One-sample t-testn − 132 cars → t(31)
Paired t-testn − 1 (pairs)10 patients → t(9)
Independent t-test (Student)n₁ + n₂ − 230 + 30 guinea pigs → t(58)
Welch’s t-testWelch-Satterthwaite formula, usually not a whole numberSame data → t(55.31)
One-way ANOVAk − 1 (between), N − k (within)3 doses, 60 animals → F(2, 57)
Chi-square test of independence(rows − 1) × (columns − 1)4 × 4 table → χ²(9)
Chi-square goodness of fitcategories − 14 hair colours → χ²(3)
Pearson correlationn − 232 cars → r(30)
Multiple regression (overall F)p (predictors), n − p − 1 (residual)4 coefficients, 32 cars → F(4, 27)

Why Welch’s df aren’t whole numbers

Welch’s t-test doesn’t assume equal variances, and its degrees of freedom are estimated from both groups’ variances and sizes. The result is usually a decimal, such as t(55.31). That’s correct, not an error. Report it to one or two decimal places.

Using df to check results

Degrees of freedom are a quick sanity check on any analysis, your own or someone else’s:

  • An independent t-test on 40 participants should have df = 38. If it shows 39 or 79, something is off, such as cases dropped for missing data or the wrong test.
  • An ANOVA on 3 groups must have 2 numerator df. Anything else means a different design was analysed.
  • Lower df than expected usually means missing data were excluded. Report how many cases each analysis used.

Reporting

In APA style, df go in brackets straight after the statistic: t(58) = −1.92, F(2, 57) = 67.42, χ²(9, N = 592) = 138.29, r(30) = −.87. For F, give both df, numerator first.

More in Hypothesis testing

Try it with the free tools

Run this on your own data

Upload a dataset and ask your question in plain English. Analytika checks the assumptions, picks the test, runs it, and writes the results up in APA format.

Try it free