| Too Little | About Right | Too Much | Total | |
|---|---|---|---|---|
| Dem | 17 | 14 | 12 | 43 |
| Ind | 20 | 28 | 24 | 72 |
| Rep | 24 | 8 | 2 | 34 |
| Total | 61 | 50 | 38 | 149 |
b. Chi-Square Inference
Math 115
14a — GSS 2016, party × military-spending opinion, a 3×3 table of 149 U.S. adults. Each cell: observed count on top, expected count (if H_0 / independence held) below.
| Party | Too Little | About Right | Too Much | Total |
|---|---|---|---|---|
| Dem | 17 (17.6) |
14 (14.4) |
12 (11) |
43 |
| Ind | 20 (29.5) |
28 (24.2) |
24 (18.4) |
72 |
| Rep | 24 (13.9) |
8 (11.4) |
2 (8.7) |
34 |
| Total | 61 | 50 | 38 | 149 |
Recall the logic (14a). X^2 = \sum_{\text{all cells}} \frac{(O - E)^2}{E} adds up how far each observed count falls from its expected count, across the whole table:
For the military table, X^2 \approx 18.97.
Today’s question: is 18.97 “big enough” to reject H_0? We need a reference distribution — the X^2 values we’d expect if H_0 were true.
When conditions are met (next slide), X^2 under H_0 follows a chi-square distribution with degrees of freedom set by the table size.
For an r \times c contingency table:
df = (r - 1) \times (c - 1)
Intuition. Once the row and column totals are fixed, only (r-1)(c-1) cells can vary freely — the rest are pinned down by the totals.
Try it: what’s df for the 3×3 military table (3 parties × 3 opinion levels)?
df = (3 - 1) \times (3 - 1) = 2 \times 2 = 4. So we compare X^2 = 18.97 to a chi-square distribution with df = 4.
Two conditions before we trust the chi-square distribution as the reference:
| Condition | Rule |
|---|---|
| Independence | Each individual independent of the others — a random sample or random assignment, otherwise justified from study context. |
| Sample size | At least 5 expected counts in every cell. Check E (expected), not the observed counts. |
Military table. Independence holds — GSS draws a random sample of U.S. adults ✓. The sample-size condition needs the expected counts; rather than compute all nine, we’ll find just the smallest one next.
Every cell needs expected ≥ 5. Since \text{Expected} = \dfrac{\text{row} \times \text{col}}{\text{grand}}, the smallest expected count sits where the row and column totals are both smallest — check one cell, not nine.
| Too Little | About Right | Too Much | Total | |
|---|---|---|---|---|
| Dem | 17 | 14 | 12 | 43 |
| Ind | 20 | 28 | 24 | 72 |
| Rep | 24 | 8 | 2 | 34 |
| Total | 61 | 50 | 38 | 149 |
Smallest row total: Rep = 34 (orange).
Smallest column total: Too Much = 38 (blue).
Rep × Too Much — observed count here is just 2.
Expected: E_{\min} = \dfrac{34 \times 38}{149} \approx 8.67 \ge 5 ✓ — every cell clears.
Results: X^2 = 18.97, df = 4, p-value \approx 8\times 10^{-4} — well below 0.05 → reject H_0.
In context: Among U.S. adults, opinion on military spending is associated with political party. Republicans were much more “Too Little” and much less “Too Much” than expected (more supportive of military spending); Independents leaned the opposite way more mildly (less supportive).
Scope of inference.
Heads up: the chi-square test answers “is there any association?” — not which groups differ or which direction. The cell contributions only suggest where the mismatch is largest; formally pinning down which groups differ waits for the pairwise follow-up tests in topic 16.
Same 149 GSS respondents, same parties — does opinion on space exploration depend on party? New 3×3 table:
| Party | Too Little | About Right | Too Much | Total |
|---|---|---|---|---|
| Dem | 8 | 22 | 13 | 43 |
| Ind | 13 | 37 | 22 | 72 |
| Rep | 9 | 17 | 8 | 34 |
| Total | 30 | 76 | 43 | 149 |
Computed for you: X^2 \approx 1.33, df = 4.
Recall: X^2 \approx 1.33, df = 4. The shaded region to the right of X^2 is the p-value.
| Question | X^2 | df | p-value | Decision (α = 0.05) |
|---|---|---|---|---|
| Military spending vs party | 18.97 | 4 | \approx 8\times 10^{-4} | Reject H_0 — clear association |
| Space spending vs party | 1.33 | 4 | \approx 0.86 | Fail to reject H_0 — no evidence of association |
Same 149 people, same three parties, same three opinion levels — but the topic changes everything. Party views split on military spending; party views look indistinguishable on space spending.
The chi-square test answers each question on its own — for these variables, is there an association at all?
The chi-square test generalizes the two-proportion test from topic 10:
| Two Proportions (Topic 10) | Chi-Square Test (Topic 14) | |
|---|---|---|
| Table size | 2 × 2 only | Any r \times c |
| Statistic | \hat{p}_1 - \hat{p}_2 | X^2 |
| Reference distribution | Standard normal | Chi-square, df = (r-1)(c-1) |
| What we test | p_1 - p_2 = 0 | Independence |
| Tail(s) used for p-value | One- or two-sided, depending on H_A | Always right tail |
For a 2×2 table the chi-square test is equivalent to a two-sided topic-10 test — they give the same p-value and same decision. Chi-square is the right tool once the table grows beyond 2×2, because no single “difference in proportions” can summarize bigger tables.
We’ve added the chi-square test to the toolkit — for two categorical variables of any size, asking whether the two are associated.
Next: multiple means. Topic 15 tackles the matching question for numerical data — given three or more groups, are any of their mean responses different? — using the F-statistic and ANOVA.