Step by step
The question
Question: spring: 20 rain, 30 dry; summer: 10 rain, 40 dry; autumn: 25 rain, 25 dry: at the 5% 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: spring, 50; summer, 50; autumn, 50.
Each column's total: rain, 55; dry, 95.
And everyone: 150.
3 Expected counts
If there is no link, each cell expects its row total times its column total, over the grand total.
Spring, rain: 50 times 55, over 150, is about 18.3333.
Spring, dry: 50 times 95, over 150, is about 31.6667.
Summer, rain: 50 times 55, over 150, is about 18.3333.
Summer, dry: 50 times 95, over 150, is about 31.6667.
Autumn, rain: 50 times 55, over 150, is about 18.3333.
Autumn, dry: 50 times 95, over 150, is about 31.6667.
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.
20 minus 18.3333 is 1.6667.
Squared, 2.7779.
Over 18.3333: 0.1515.
30 minus 31.6667 is −1.6667.
Squared, 2.7779.
Over 31.6667: 0.0877.
10 minus 18.3333 is −8.3333.
Squared, 69.4439.
Over 18.3333: 3.7879.
40 minus 31.6667 is 8.3333.
Squared, 69.4439.
Over 31.6667: 2.193.
25 minus 18.3333 is 6.6667.
Squared, 44.4449.
Over 18.3333: 2.4243.
25 minus 31.6667 is −6.6667.
Squared, 44.4449.
Over 31.6667: 1.4035.
5 Add them
0.1515 plus 0.0877 plus 3.7879 plus 2.193 plus 2.4243 plus 1.4035 is 10.0479.
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.05.
Row 2, column .05: the cut-off is 5.991.
7 Decide
The chi-square curve for df 2.
Past the cut-off, 5.991, is the reject part.
10.0479 is past the cut-off.
So we reject H zero.
8 Say it in words
In words: at the 5% 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.
Spring: 18.3333 plus 31.6667 is 50.
Summer: 18.3333 plus 31.6667 is 50.
Autumn: 18.3333 plus 31.6667 is 50.
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.