Step by step
The question
Question: morning: 30 pass, 10 fail; evening: 20 pass, 20 fail: 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: morning, 40; evening, 40.
Each column's total: pass, 50; fail, 30.
And everyone: 80.
3 Expected counts
If there is no link, each cell expects its row total times its column total, over the grand total.
Morning, pass: 40 times 50, over 80, is 25.
Morning, fail: 40 times 30, over 80, is 15.
Evening, pass: 40 times 50, over 80, is 25.
Evening, fail: 40 times 30, over 80, is 15.
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.
30 minus 25 is 5.
Squared, 25.
Over 25: 1.
10 minus 15 is −5.
Squared, 25.
Over 15: 1.6667.
20 minus 25 is −5.
Squared, 25.
Over 25: 1.
20 minus 15 is 5.
Squared, 25.
Over 15: 1.6667.
5 Add them
1 plus 1.6667 plus 1 plus 1.6667 is 5.3334.
6 The cut-off
df is rows minus 1, times columns minus 1: 1 times 1 is 1.
Careful!
Not the number of cells minus 1.
Rows minus 1, times columns minus 1: 1.
Chi-square is always a right-tail test: big means far from what we expected.
Row 1, column 0.05.
Row 1, column .05: the cut-off is 3.841.
7 Decide
The chi-square curve for df 1.
Past the cut-off, 3.841, is the reject part.
5.3334 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.
Morning: 25 plus 15 is 40.
Evening: 25 plus 15 is 40.
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.