Module 4 · Lesson 17 of 22
Chi-square association testing
Learning objectives
- Build a contingency table for two categorical variables.
- Check expected counts and interpret residuals.
- Distinguish association from causation.
Chi-square association
H0 is independence between the two categorical variables. Compare observed and expected counts; large discrepancies produce a large chi-square statistic.
Use counts (not percentages), independent observations, mutually exclusive categories and adequate expected counts.
Garment-factory example
Test whether defect-type distribution differs by production line, using counts (not percentages) per cell.
Method
- Cross-tabulate raw counts.
- Compute expected counts.
- Run the test in a free tool.
- Inspect standardised residuals to see which cells drive association.
Common mistakes
- Entering percentages instead of counts.
- Treating association as causation.
Knowledge check
Pick one answer per question. Explanations appear after you submit.
1. The chi-square association test requires:
2. Standardised residuals help to:
Author: Sanjeewa Dehiwalage · Last reviewed: 2026-07-21