3 × 4 table
(r − 1)(c − 1)
6.
For a contingency table with rows and columns, . For a goodness-of-fit test with categories and parameters estimated from the data, .
This page is easier if you are comfortable with:
Degrees of freedom count the number of independent pieces of information. In an table with all row and column totals fixed, only cells can be chosen freely. For a table . The value of selects the row of the chi-squared table used to read the critical value; the statistic itself is in the chi-squared test statistic.
In a goodness-of-fit test, the frequencies must add to the total, which removes 1, and each parameter estimated from the data removes another. For 6 categories (a die) with no estimated parameter, . For a Poisson fit with 5 classes where is estimated from the data, ; see the Poisson distribution.
The tests are described in the chi-squared test of independence. A related count of "free" quantities appears in the t distribution with n − 1 degrees of freedom and in analysis of variance.
The degrees of freedom count how many values in a table or fit can vary freely, and choose the critical value.
More categories give more freedom; each fitted parameter takes one away.
These examples are worked by hand, step by step, so you can compare your own working.
Find the degrees of freedom for a contingency table with 3 rows and 4 columns.
Find the degrees of freedom for testing whether a die with 6 faces is fair.
A Poisson distribution is fitted to 5 classes, estimating from the data. Find the degrees of freedom.
A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.
(r − 1)(c − 1)
6.
ν
1.
n − 1 − m
4.
ν
16.
Contingency table: ν = (r − 1)(c − 1). Goodness of fit: ν = n − 1 − m, where m parameters are estimated.
Rows and columns.
Smallest table.
6 categories, 1 estimated parameter.
Large table.
all cells ✗
(r − 1)(c − 1) ✓
Totals fixed.
n − 1 ✗
n − 1 − m ✓
Each costs one.
n ✗
n − 1 ✓
Total fixed.
include ✗
exclude totals ✓
Table size.
Try each one on paper, then open the answer. Use the solver above to see the full working.
6
4
7
5
25
2
Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.
Solve: …
(r − 1)(c − 1).
n − 1 − m.
The number of parameters estimated.
The total is fixed.
chi-squared statistic.
chi-squared test of independence.
More in Advanced statistics and stochastic processes and the formula sheets.