Mathfolis

Chi-Square Test for Independence

Unit 8 · Inference for Categorical Data: Chi-Square

What AP Stats asks here

The chi-square test for independence asks whether two categorical variables are associated within a single population. Arithmetically identical to the homogeneity test, but the design is one random sample classified two ways. The most common AP trap: concluding causation from a significant association.

Independence test

Expected count
Eij=(row totali)(col totalj)grand totalE_{ij} = \dfrac{(\text{row total}_i)(\text{col total}_j)}{\text{grand total}}
Test statistic
χ2=(OijEij)2Eij\chi^2 = \sum \dfrac{(O_{ij} - E_{ij})^2}{E_{ij}}
Degrees of freedom
(r1)(c1)(r - 1)(c - 1)

Design diagnostic

Independence
one sample, classified two ways; both marginals random\text{one sample, classified two ways; both marginals random}
AP Tip: Homogeneity and independence share the same numbers. The only thing that changes is the sampling design (separate samples vs one sample) and the conclusion sentence (distributions differ vs variables associated).
Caution: Rejecting independence shows association, not causation. Causation requires random assignment, not just a small p-value.
Type 1

Recognize independence design

If one random sample is classified by two categorical variables, the design calls for the independence test.

Example 1
A market researcher randomly samples 800 adults and records age group and brand preference. Which test applies? (A) Chi-square goodness-of-fit (B) Chi-square test for homogeneity (C) Chi-square test for independence — single sample classified two ways (D) Two-sample z-test

Practice more of this type— AI-generated · always-new problems

Generate Problems →
Type 2

Expected counts and chi-square

Same formula as homogeneity. The conclusion talks about association within a single population.

Example 2
A 3 × 3 table with n=500n = 500: row totals (160, 200, 140) and column totals (140, 220, 140). What is the expected count in the row 1, column 1 cell, and what is the df? (A) Expected = 28, df = 4 (B) Expected = 44.8, df = 4 (C) Expected = 44.8, df = 8 (D) Expected = 56, df = 2

Practice more of this type— AI-generated · always-new problems

Generate Problems →
Type 3

Association vs causation

Significant chi-square ⇒ association in this population. To claim causation, you need random assignment, not statistical significance.

Example 3
A chi-square test for independence rejects H0H_0 for smoking status and lung disease at p<0.001p < 0.001. A student writes 'We have proven that smoking causes lung disease.' Which critique is correct? (A) The student is correct because the p-value is tiny. (B) Rejection shows strong evidence of association, not causation. Causation requires random assignment, not a chi-square test. The correct claim is 'smoking and lung disease are associated in this population.' (C) Rejection proves causation only if p<0.0001p < 0.0001. (D) The chi-square test is invalid for medical data.

Practice more of this type— AI-generated · always-new problems

Generate Problems →
Chi-Square Test for Independence | AP Statistics — Mathfolis