Table (10 20; 30 40)
E₁₁ = 30 × 40/100
12.
For a contingency table the expected count in cell under independence is (row total times column total over the grand total), and with degrees of freedom.
This page is easier if you are comfortable with:
Take the table : row and column totals are all 50 and , so every expected count is , and on 1 degree of freedom, just above the 5% critical value 3.841. For : totals 30, 70 and 40, 60 give expected counts 12, 18, 28, 42, and : no evidence of association.
The expected count rule comes from multiplying probabilities of independent events (independent events): , times cases. For , . All expected counts should be at least about 5 for the approximation to hold. The statistic and its degrees of freedom are explained in the chi-squared test statistic and chi-squared degrees of freedom.
The test checks association, not causation, and with large tiny differences become significant. It is a special case of the likelihood-ratio test (the likelihood-ratio statistic) for the multinomial model (the multinomial distribution), and the strength of association in a 2 × 2 table is measured by the phi coefficient (the correlation of the indicator variables, the correlation coefficient).
The test compares observed table counts with the counts expected if the two variables were independent.
The contributions add to 0.794, well below the 5% critical value 3.84.
These examples are worked by hand, step by step, so you can compare your own working.
Find for .
Find for .
Find for .
A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.
E₁₁ = 30 × 40/100
12.
E₁₂ = 18, E₂₁ = 28, E₂₂ = 42
They sum to 100.
4/12 + 4/18 + 4/28 + 4/42
0.7937.
(2 − 1)(2 − 1)
1.
Under independence E_ij = R_i C_j / N, and χ² = Σ(O − E)²/E with (r − 1)(c − 1) degrees of freedom. Large χ² is evidence of association.
Row 1 total 30, column 1 total 40, N = 100. Find E₁₁.
E₁₂ = 18, E₂₁ = 28, E₂₂ = 42 with E₁₁ = 12. Check the sum.
Each |O − E| = 2. Find Σ4/E.
Find (r − 1)(c − 1) for a 2 × 2 table.
using observed ✗
E = RC/N ✓
Expected under independence.
wrong ✗
(r − 1)(c − 1) ✓
Margins fixed.
ignored ✗
need E ≥ 5 ✓
Approximation.
use counts ✗
use raw counts ✓
χ² needs counts.
Try each one on paper, then open the answer. Use the solver above to see the full working.
25
6
4
6
3
12
Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.
Solve: …
Whether two categorical variables are associated.
Row total × column total ÷ N.
(r − 1)(c − 1).
When expected counts are at least about 5.
likelihood-ratio statistic.
More in Advanced statistics and stochastic processes and the formula sheets.