9231 · 4.3
χ²-tests — FAQ
Frequently asked questions for 9231 χ²-tests. Direct answers first, then deeper explanation — then practise with marking.
What's the difference between a goodness of fit test and a test for independence?
A goodness of fit test compares one set of observed categorical data (from one variable) against a theoretical distribution. A test for independence uses a two-way contingency table to see if there is a relationship between two different categorical variables.
What do I do if an expected frequency is 5 or less?
You must combine that category (or cell) with an adjacent one. For a goodness of fit test, you might combine '4 or more defects'. For a contingency table, you might combine two rows or two columns. After combining, you must use the new number of categories/rows/columns to calculate the degrees of freedom. You should always state which categories you have combined.
Why are the degrees of freedom calculated differently for the two tests?
The degrees of freedom reflect the number of values that are 'free to vary'. In a goodness of fit test, once you've filled (k-1) categories and you know the total, the last category is fixed. So ν starts at k-1. In a contingency table with 'r' rows and 'c' columns, once you've filled in (r-1) rows and (c-1) columns, the remaining cells are all fixed by the row and column totals. This gives (r-1)(c-1) free choices.