Lesson 13 — Degrees of Freedom Cookbook
Every statistical test requires degrees of freedom (df).
Degrees of freedom tell us how many independent pieces of information are available once totals or means are fixed.
They determine which row of the t-table or F-table we use.
General rule:
$$df = \text{number of observations} - \text{number of constraints}$$
t-tests
- One-sample t-test:
$$df = n - 1$$ - Independent-samples t-test:
$$df = n_1 + n_2 - 2$$ - Paired-samples t-test:
$$df = n - 1$$
One-way ANOVA
- Between groups:
$$df_{\text{between}} = k - 1$$ - Within groups:
$$df_{\text{within}} = N - k$$ - Total:
$$df_{\text{total}} = N - 1$$
Where $$k$$ = number of groups, $$N$$ = total number of scores.
Factorial ANOVA (2 × 2 Example)
- Factor A: $$df_A = a - 1$$
- Factor B: $$df_B = b - 1$$
- Interaction: $$df_{A \times B} = (a-1)(b-1)$$
- Error: $$df_{\text{within}} = N - ab$$
Repeated-Measures ANOVA
- Rows (subjects): $$df_{\text{rows}} = n - 1$$
- Columns (conditions): $$df_{\text{columns}} = k - 1$$
- Error: $$df_{\text{error}} = (n - 1)(k - 1)$$
Where $$n$$ = number of subjects, $$k$$ = number of conditions.
Mixed (Split-Plot) ANOVA
- Between factor: $$df_{\text{between}} = a - 1$$
- Subjects within groups: $$df_{\text{subjects}} = N - a$$
- Within factor: $$df_{\text{within}} = b - 1$$
- Interaction: $$df_{A \times B} = (a-1)(b-1)$$
Chi-square
- Goodness-of-fit: $$df = k - 1$$
- Independence: $$df = (r - 1)(c - 1)$$
Where $$k$$ = number of categories, $$r$$ = rows, $$c$$ = columns.
Visuals
| Test / Design | df formula | Notes |
|---|---|---|
| One-sample t-test | \( df = n - 1 \) | Single group vs. constant. |
| Independent-samples t-test | \( df = n_1 + n_2 - 2 \) | Equal-variance (pooled) case. |
| Paired-samples t-test | \( df = n - 1 \) | Based on the \( n \) differences. |
| One-way ANOVA — Between | \( df_{\text{between}} = k - 1 \) | \( k \) groups. |
| One-way ANOVA — Within (Error) | \( df_{\text{within}} = N - k \) | \( N \) total scores. |
| One-way ANOVA — Total | \( df_{\text{total}} = N - 1 \) | Sum of between + within df. |
| Factorial ANOVA — Factor A | \( df_A = a - 1 \) | \( a \) levels of A. |
| Factorial ANOVA — Factor B | \( df_B = b - 1 \) | \( b \) levels of B. |
| Factorial ANOVA — Interaction | \( df_{A\times B} = (a-1)(b-1) \) | Interaction A×B. |
| Factorial ANOVA — Error (Within) | \( df_{\text{within}} = N - ab \) | \( ab \) cells total. |
| Repeated-measures ANOVA — Subjects (Rows) | \( df_{\text{rows}} = n - 1 \) | \( n \) subjects. |
| Repeated-measures ANOVA — Conditions (Columns) | \( df_{\text{columns}} = k - 1 \) | \( k \) conditions. |
| Repeated-measures ANOVA — Error | \( df_{\text{error}} = (n - 1)(k - 1) \) | Subjects × conditions. |
| Mixed (Split-Plot) ANOVA — Between factor | \( df_{\text{between}} = a - 1 \) | \( a \) groups (between-subjects). |
| Mixed (Split-Plot) ANOVA — Subjects within groups | \( df_{\text{subjects}} = N - a \) | \( N \) subjects total. |
| Mixed (Split-Plot) ANOVA — Within factor | \( df_{\text{within}} = b - 1 \) | \( b \) repeated levels. |
| Mixed (Split-Plot) ANOVA — Interaction | \( df_{A\times B} = (a-1)(b-1) \) | Between × within. |
| Chi-square — Goodness-of-fit | \( df = k - 1 \) | \( k \) categories. |
| Chi-square — Independence | \( df = (r - 1)(c - 1) \) | \( r \) rows, \( c \) columns. |
Variables: \( n \)=sample size, \( n_1,n_2 \)=group sizes, \( N \)=total scores, \( k \)=# of groups/conditions, \( a,b \)=levels of factors A,B, \( r,c \)=rows, columns.
Why This Matters
Degrees of freedom link sample size to critical values.
They tell us how much room for variability exists in the data.
With this quick cookbook, you can locate the right df for any test.
Practice self-test quiz
In the space below, please find practice problems and self-test quizzes. For full access, please signup free.

