What you'll learn
Chi-square (χ²) tests for categorical data (~2–5%).
The three tests
- Goodness of fit: does one categorical variable match a claimed distribution? (one sample, one variable)
- Independence: are two categorical variables associated? (one sample, two variables, a two-way table)
- Homogeneity: do several populations/groups have the same distribution of a categorical variable?
The statistic
χ² = Σ (observed − expected)² / expected. Larger χ² → more evidence against H₀. Degrees of freedom: GOF = (categories − 1); two-way = (rows − 1)(cols − 1).
Conditions
Random; 10% (independence); all expected counts ≥ 5.
Conclusion
Compare the p-value to α: small p-value → reject H₀ (the distribution differs / variables are associated / groups differ). State in context.
Exam tips
- Pick the right test from the design (1 sample 1 variable vs 2 variables vs several groups).
- Compute expected counts = (row total × column total)/grand total.
Common mistakes
- Using observed instead of expected in the denominator.
- Confusing independence vs homogeneity (depends on how data were collected).