Degrees of freedom (df) is the number of values in a chi-squared test that can vary independently once the totals or other constraints are fixed. It determines which chi-squared distribution is used to calculate the critical value or -value.
Why Degrees of Freedom Are Needed
A chi-squared test compares observed frequencies with expected frequencies. However, not every frequency can vary freely because row totals, column totals, or the overall sample size impose constraints.
For example, suppose four expected category frequencies must total . Once the first three frequencies are known, the fourth is fixed because it must make the total . Therefore, only three values are independent, so .
The formula depends on the type of chi-squared test:
| Test | Degrees of freedom | Example |
|---|---|---|
| Chi-squared test for independence | , where is the number of rows and is the number of columns |
For an independence test, fixing the row and column totals means only cells can vary independently. The remaining cells are determined by those totals.
A common misconception is that degrees of freedom equals the total number of observations. It does not: it depends on the number of categories or table dimensions, not the sample size.
IB Exam Technique
This is SL 4.11: Hypothesis testing and may appear on either GDC-active paper. State the correct formula, substitute the dimensions clearly, and use the resulting (df) when finding the critical value or interpreting the GDC output. Do not count total rows or columns containing totals, and remember that IB notation uses , not calculator-only notation.
