Skip to content
FiftyCalc Free calculators for all 50 states

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

Sample figures

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.

Degrees of Freedom Calculator

Sample 1 size (n₁): enter 2 or more. Prefilled example: 20.

Sample 1 standard deviation (s₁): enter 0 or more. Prefilled example: 4.1.

Sample 2 size (n₂): enter 2 or more. Prefilled example: 25.

Sample 2 standard deviation (s₂): enter 0 or more. Prefilled example: 6.3.

Table rows (chi-square test): enter 2 or more. Prefilled example: 3.

Table columns or categories (chi-square test): enter 2 or more. Prefilled example: 4.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. Sample 1 size (n₁): enter 2 or more.
  2. Sample 1 standard deviation (s₁): enter 0 or more.
  3. Sample 2 size (n₂): enter 2 or more.
  4. Sample 2 standard deviation (s₂): enter 0 or more.
  5. Table rows (chi-square test): enter 2 or more.
  6. Table columns or categories (chi-square test): enter 2 or more.
  7. 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

  1. W=(s12÷n1+s22÷n2)2(s12÷n1)2÷(n1−1)+(s22÷n2)2÷(n2−1)
Symbols used in the formula
SymbolMeaning
n1Sample 1 size (n₁)
s1Sample 1 standard deviation (s₁)
n2Sample 2 size (n₂)
s2Sample 2 standard deviation (s₂)
WTwo-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 − 13
  1. W=(4.12÷20+6.32÷25)2(4.12÷20)2÷(20−1)+(6.32÷25)2÷(25−1)=41.4602

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.

Questions answered

Related calculators