Priority labels: ImportantNeutralLess important show where to spend revision time.
When chi-square appliesImportant
Use chi-square methods when the data are counts of observations falling into categories: a frequency table for one categorical variable, or a two-way (contingency) table. The counts must be real counts; if you only have percentages, convert back using the sample size. Chi-square is not for means, and it is unreliable when expected counts are tiny.
| Chapter | Variables | Groups |
|---|---|---|
| 10 / 12 | 1 binary categorical | 1 |
| 14 | 1 quantitative | 2 |
| 15 | 1–2 categorical, any number of categories | 1 or several |
Three tests, one statisticImportant
| Test | Question | Data | H₀ | df |
|---|---|---|---|---|
| Goodness-of-fit | Does one variable follow a stated distribution? | 1 variable, 1 sample, k cells | Counts follow the model proportions | k − 1 |
| Homogeneity | Is the distribution of a variable the same across groups? | 1 variable, r separate groups | Same distribution in every group | (r − 1)(c − 1) |
| Independence | Are two variables associated? | 2 variables, 1 sample | Variables are independent | (r − 1)(c − 1) |
Homogeneity and independence use identical arithmetic; what differs is the sampling story and the wording of the conclusion ("the distributions are the same" versus "the variables are independent").
The test statisticImportant
- χ² ≥ 0, and it grows as the data drift away from the model.
- Only large values count against H₀, so the test is always one-sided: p = P(χ²_df > observed).
- The χ² curve is right-skewed with mean = df; it flattens and shifts right as df grows.
- The critical value depends on df only, not on n — which is why very large samples flag even small departures.
Expected countsImportant
Always check the expected counts, not the observed ones. If you run the test on a TI-84 the matrix [B] stores them for inspection.
ConditionsImportant
- Counted data — frequencies, not percentages or measurements.
- Independence — a random sample or random assignment.
- Expected cell frequency — every expected count at least 5.
If a cell falls short, merge categories where that is sensible (or use Fisher's exact test, which is outside this course). The TI-84 gives no warning, so look at [B] yourself.
Which cells drive the result: standardised residualsImportant
Only after a significant result, scan the residuals: |value| above 2 is noteworthy and above 3 is striking. The sign shows the direction (positive = more than expected). Squaring and summing the residuals reproduces χ².
Plan choice in three cities (homogeneity)
100 customers per city choose a basic, standard or premium plan. Observed counts — City A: 50, 35, 15; City B: 30, 45, 25; City C: 20, 40, 40. Is the plan mix the same in all cities?
Hypotheses and df
Expected counts
Conditions
Statistic
Residuals
Reject H₀: plan preferences differ by city. Basic is over-represented in A, premium in C.
Goodness-of-fit: weekday traffic
A shop expects 20%, 25%, 25% and 30% of its 120 weekly visitors to arrive on four set days, but it counts 18, 31, 27, 44.
Expected counts
Statistic
p ≈ 0.31: the counts are consistent with the expected mix.
The 2 × 2 special caseImportant
For a 2 × 2 table the homogeneity test (df = 1) is the same as the two-proportion z-test: χ² = z² and the p-values coincide. The course prefers χ² for the test, but only the z-interval gives a confidence interval for the difference p₁ − p₂.
Example: 48 of 60 versus 30 of 60 successes gives χ² ≈ 11.87 on 1 df (p ≈ 0.0006), equal to z² with z ≈ 3.44.
Nine steps for any chi-square testImportant
- Pick the test (fit / homogeneity / independence).
- State H₀ and H_A in words.
- Check the three conditions.
- Find df.
- Compute expected counts.
- Compute χ².
- Get the p-value from the right tail.
- Conclude in context.
- If significant, inspect the standardised residuals.
PitfallsImportant
- Feeding percentages instead of counts into the test.
- Small expected counts (below 5) breaking the approximation.
- Over-reading significance in large samples; check effect size.
- Reading "association" as "causation" — χ² treats rows and columns symmetrically.
- Mixing up fit (df = cells − 1) and independence (df = (r−1)(c−1)).
ToolsNeutral
TI-84: matrix [A] then STAT ▸ TESTS ▸ C:χ²-Test; goodness-of-fit with D:χ²GOF-Test (L1 observed, L2 expected, df = k − 1); a p-value from a known statistic with χ²cdf(x, 1E99, df).
Key takeaways
- One formula Σ(O − E)²/E covers fit, homogeneity and independence; only E and df differ.
- Check expected counts ≥ 5 and use real counts.
- After a rejection, standardised residuals show which cells caused it.