Degrees of freedom
If we have a contingency table with dimensions
v = (r - 1)(c - 1)
The degrees of freedom is the number of rows, minus one, all multiplied by the number of columns minus one.
How do we get this?
Let’s take this (very abstract) contingency table for example:
| Yes | No | Total | |
|---|---|---|---|
| A | 10 | 20 | 30 |
| B | 15 | 25 | 40 |
| C | 5 | 15 | 20 |
| Total | 30 | 60 | 90 |
We have
What is the maximum number of cells in the main body of the table (the cells with the numbers in them, but not the totals) can we completely remove, while still being able to find them from the rest of the table?
Here’s one example of the maximum number of cells we can remove:
| Yes | No | Total | |
|---|---|---|---|
| A | 10 | 30 | |
| B | 15 | 40 | |
| C | 20 | ||
| Total | 30 | 60 | 90 |
From just these
| Yes | No | Total | |
|---|---|---|---|
| A | 10 | 30 | |
| B | 15 | 40 | |
| C | 20 | ||
| Total |
Because the maximum number of cells we need to keep in order to retain all the data is
If we instead calculated the degrees of freedom using the formula, we would do
flashcards
| Question | Answer |
|---|---|
| Degrees of freedom for a contingency table with dimensions | |
| How do you calculate degrees of freedom for a contingency table? | |
| What does | Degrees of freedom |
| What is the number of degrees of freedom in a | |
| In a | Because you need a minimum of 2 cells to reconstruct all others |
| What is the maximum number of cells you can remove from a | 2 cells |
| In the example table, what values are kept to demonstrate degrees of freedom? | 10 (A Yes) and 15 (B Yes) |
| With 10 and 15 kept, how is C Yes found? | |
| With 10 and 15 kept, how is A No found? | |
| With 10 and 15 kept, how is B No found? | |
| With 10 and 15 kept, how is C No found? |