Step by step
The question
Question: x: 40 yes, 20 no; y: 30 yes, 30 no; z: 20 yes, 40 no: at the 1% level, is the answer linked to the group?
1 Write the hypotheses
H₀ is the "nothing new" idea.
Here: the group and the answer are independent.
Hₐ is what we want to show.
Here: the group and the answer are not independent.
Independent means no link: the answer does not depend on the group.
2 Totals
The counts in a table.
Each row's total: x, 60; y, 60; z, 60.
Each column's total: yes, 90; no, 90.
And everyone: 180.
3 Expected counts
If there is no link, each cell expects its row total times its column total, over the grand total.
X, yes: 60 times 90, over 180, is 30.
X, no: 60 times 90, over 180, is 30.
Y, yes: 60 times 90, over 180, is 30.
Y, no: 60 times 90, over 180, is 30.
Z, yes: 60 times 90, over 180, is 30.
Z, no: 60 times 90, over 180, is 30.
4 Each part
Chi-square adds up, for each cell, the observed minus the expected, squared, over the expected.
A table: each cell, what we saw, O, and what we expected, E.
40 minus 30 is 10.
Squared, 100.
Over 30: 3.3333.
20 minus 30 is −10.
Squared, 100.
Over 30: 3.3333.
30 minus 30 is 0.
Squared, 0.
Over 30: 0.
30 minus 30 is 0.
Squared, 0.
Over 30: 0.
20 minus 30 is −10.
Squared, 100.
Over 30: 3.3333.
40 minus 30 is 10.
Squared, 100.
Over 30: 3.3333.
5 Add them
3.3333 plus 3.3333 plus 0 plus 0 plus 3.3333 plus 3.3333 is 13.3332.
6 The cut-off
df is rows minus 1, times columns minus 1: 2 times 1 is 2.
Careful!
Not the number of cells minus 1.
Rows minus 1, times columns minus 1: 2.
Chi-square is always a right-tail test: big means far from what we expected.
Row 2, column 0.01.
Row 2, column .01: the cut-off is 9.210.
7 Decide
The chi-square curve for df 2.
Past the cut-off, 9.210, is the reject part.
13.3332 is past the cut-off.
So we reject H zero.
8 Say it in words
In words: at the 1% level, there is enough evidence that the group and the answer are not independent.
9 Check
Let's check: the expected counts give the same row totals.
X: 30 plus 30 is 60.
Y: 30 plus 30 is 60.
Z: 30 plus 30 is 60.
So it is right!
Let's look back.
First: write the hypotheses.
Then: totals.
Then: expected counts.
Then: each part.
Then: add them.
Then: the cut-off.
Then: decide.
Then: say it in words.
Last: check.