Unit 8: Inference for Categorical Data: Chi-Square
Chi-Square Test for Independence
Testing for an association between two categorical variables.
Prerequisites
- Chi-Square Goodness of Fit
Formally Testing the Association Seen Informally in Unit 2
Unit 2's two-way table showed 30% of juniors and 60% of seniors held part-time jobs — a difference that looked meaningful, but was only compared informally. Before reading on: could that same reasoning — comparing observed counts to what would be expected if the two variables were unrelated — be turned into a formal significance test?
Definition — Chi-Square Test for Independence
Worked Example — Testing the Grade Level and Job Status Table from Unit 2
Since χ² = 18.18 is far larger than 3.841, reject H₀: there is convincing evidence of an association between grade level and part-time job status. This confirms, formally, what the conditional distributions suggested informally in Unit 2 — juniors and seniors genuinely differ in how likely they are to hold a job, not just by chance sampling variation.
Tip
Common Mistakes
Concluding a chi-square test for independence proves grade level causes different job-holding rates.
This is observational data — no variable was randomly assigned — so, exactly as in Unit 3, only an association is established, never causation.
Confusing a test for independence (one sample, two variables) with a test for homogeneity (several samples, one variable).
The arithmetic is identical either way, but the study design differs — one random sample classified by two variables calls for 'independence'; separate samples from distinct populations compared on one variable calls for 'homogeneity.'
Key Takeaways
- A chi-square test for independence formalizes the same observed-vs-expected comparison a two-way table's conditional distributions suggest informally.
- Expected counts use (row total × column total)/grand total, with df = (rows−1)(columns−1).
- The test detects association, not its direction or size, and — like any test on observational data — never establishes causation.
Summary
This closes Unit 8: chi-square procedures test claims about entire categorical distributions and associations. The final unit returns to quantitative relationships, testing the regression slope from Unit 2 for statistical significance.
Sign in to track your progress and mark this lesson complete.
Track your progress