Track 10 · Comparing Groups and Categorical Data · Lesson 2 of 11
Chi-square test of independence
Test whether two categorical variables are associated with the chi-square test, check its conditions, and measure the strength of the association with Cramér's V.
An HR team sees that the share of staff who intend to stay differs between departments in this year's survey. Some difference is inevitable by chance alone — the question is whether the differences are larger than chance would produce, and if so, how large they really are.
Two categorical variables are independent when the conditional distribution of one is the same in every category of the other: the share who intend to stay would be the same in every department. The chi-square test compares the table we observed with the table we would expect if that were exactly true.
- : the variables are independent (equivalently, every group has the same distribution — a test of homogeneity uses the same arithmetic).
- : they are associated.
Included with a Formula Quest membership
It has 8 graded exercises with feedback, hints and worked solutions. After it you will be able to:
- Compute expected counts under independence and check the expected-count conditions
- Calculate the chi-square statistic, its degrees of freedom and the upper-tail p-value
- Use Fisher's exact test for sparse 2×2 tables and know that Yates' correction is conservative
- Report the strength of an association with Cramér's V and percentages, not just the p-value
- Describe a significant result as an association, not a cause