Try each one on paper first, then check a single step. That is worth far more than reading a finished solution.
Example 1 — a test for independence
Method A: 40 pass, 20 fail. Method B: 30 pass, 30 fail. Test at the 5% level whether pass rate is associated with method.
1H0: method and outcome are independent; H1: they are associated.
2Totals: rows 60 and 60, columns 70 and 50, grand total 120.
3E(A, Pass)=12060×70=35, and similarly 25,35,25.Check: they reproduce the row and column totals ✓
4χ2=3525+2525+3525+2525=3.43Each squared discrepancy divided by its expected value.
5ν=(2−1)(2−1)=1, so the critical value is 3.841.
63.43<3.841: do not reject H0. Insufficient evidence of an association at the 5% level.Close — a larger sample with the same proportions would reject.
Example 2 — a goodness-of-fit test
A die is rolled 60 times giving 8,12,9,11,10,10. Test at the 5% level whether it is fair.
1H0: the die is fair; H1: it is not.
2If fair, each face is expected 660=10 times.All expected frequencies are at least 5 ✓
3χ2=104+4+1+1+0+0The differences from 10 are −2,2,−1,1,0,0.
4=1.0
5ν=6−1=5, so the critical value is 11.07.No parameters were estimated from the data.
61.0<11.07: do not reject. The data is entirely consistent with a fair die.
Example 3 — handling a small expected frequency
A goodness-of-fit test has expected frequencies 20,15,12,8,3,2. What must be done before testing?
1The condition is that every expected frequency is at least 5.Small values make the (O−E)2/E term unstable.
2The last two, 3 and 2, fail that condition.
3Combine them into a single category with expected frequency 5.Combine the corresponding observed values too.
4There are now 5 categories rather than 6.
5So ν=5−1=4, not 5.Recomputing the degrees of freedom is the step most often forgotten.