Degrees of Freedom Calculator
Test cases replayed : 3 of 3 match · Methodology · No outside source listed
Enter the sample sizes and standard deviations of your groups, and the size of your table, to get the degrees of freedom of the common tests.
Result
Two-sample t-test, unequal variances (Welch)
Two-sample t-test, equal variances (n₁ + n₂ − 2)
- One-sample or paired t-test, sample 1 (n₁ − 1)
- Chi-square test of independence, (rows − 1)(columns − 1)
- Chi-square goodness of fit, categories − 1
Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- Sample 1 size (n₁): enter 2 or more.
- Sample 1 standard deviation (s₁): enter 0 or more.
- Sample 2 size (n₂): enter 2 or more.
- Sample 2 standard deviation (s₂): enter 0 or more.
- Table rows (chi-square test): enter 2 or more.
- Table columns or categories (chi-square test): enter 2 or more.
- Read the result: Two-sample t-test, unequal variances (Welch); the panel also shows Two-sample t-test, equal variances (n₁ + n₂ − 2), One-sample or paired t-test, sample 1 (n₁ − 1), Chi-square test of independence, (rows − 1)(columns − 1) and Chi-square goodness of fit, categories − 1.
How this calculator works
One-sample and paired t-tests: df = n − 1 (for a paired test, n is the number of pairs). Two-sample t-test with equal variances (pooled): df = n₁ + n₂ − 2.
Two-sample t-test with unequal variances, Welch–Satterthwaite equation (Satterthwaite, 1946; Welch, 1947): df = (s₁²/n₁ + s₂²/n₂)² ÷ [(s₁²/n₁)² ÷ (n₁ − 1) + (s₂²/n₂)² ÷ (n₂ − 1)]. The result is usually not a whole number.
Chi-square test of independence on an r × c table: df = (r − 1)(c − 1). Goodness-of-fit test with k categories and no parameter estimated from the data: df = k − 1.
The formula
| Symbol | Meaning |
|---|---|
| Sample 1 size (n₁) | |
| Sample 1 standard deviation (s₁) | |
| Sample 2 size (n₂) | |
| Sample 2 standard deviation (s₂) | |
| Two-sample t-test, unequal variances (Welch) |
Worked example
| Sample 1 size (n₁) | 20 |
|---|---|
| Sample 1 standard deviation (s₁) | 4.1 |
| Sample 2 size (n₂) | 25 |
| Sample 2 standard deviation (s₂) | 6.3 |
| Table rows (chi-square test) | 3 |
| Table columns or categories (chi-square test) | 4 |
| Two-sample t-test, equal variances (n₁ + n₂ − 2) | 43 |
|---|---|
| One-sample or paired t-test, sample 1 (n₁ − 1) | 19 |
| Chi-square test of independence, (rows − 1)(columns − 1) | 6 |
| Chi-square goodness of fit, categories − 1 | 3 |
Two-sample t-test, unequal variances (Welch) 41.4602
Each step uses the unrounded value of the step before it; figures on this page are rounded for display.
Frequently asked questions
Why is the Welch degrees of freedom not a whole number?
It is an approximation that weights each sample by its variance. With n₁ = 20, s₁ = 4.1, n₂ = 25 and s₂ = 6.3 it is about 41.46, between the smaller sample's 19 and the pooled 43.
How many degrees of freedom does a 3 × 4 table have?
(3 − 1) × (4 − 1) = 6 for a chi-square test of independence.