Step by step
The question
Question: group1: 25 a, 25 b, 30 c; group2: 35 a, 15 b, 30 c: 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: group1, 80; group2, 80.
Each column's total: a, 60; b, 40; c, 60.
And everyone: 160.
3 Expected counts
If there is no link, each cell expects its row total times its column total, over the grand total.
Group1, a: 80 times 60, over 160, is 30.
Group1, b: 80 times 40, over 160, is 20.
Group1, c: 80 times 60, over 160, is 30.
Group2, a: 80 times 60, over 160, is 30.
Group2, b: 80 times 40, over 160, is 20.
Group2, c: 80 times 60, over 160, 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.
25 minus 30 is −5.
Squared, 25.
Over 30: 0.8333.
25 minus 20 is 5.
Squared, 25.
Over 20: 1.25.
30 minus 30 is 0.
Squared, 0.
Over 30: 0.
35 minus 30 is 5.
Squared, 25.
Over 30: 0.8333.
15 minus 20 is −5.
Squared, 25.
Over 20: 1.25.
30 minus 30 is 0.
Squared, 0.
Over 30: 0.
5 Add them
0.8333 plus 1.25 plus 0 plus 0.8333 plus 1.25 plus 0 is 4.1666.
6 The cut-off
df is rows minus 1, times columns minus 1: 1 times 2 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.
4.1666 is not past the cut-off.
So we do not reject H zero.
8 Say it in words
In words: at the 5% level, there is not enough evidence that the group and the answer are not independent.
This does not prove H zero is true.
We just cannot rule it out.
9 Check
Let's check: the expected counts give the same row totals.
Group1: 30 plus 20 plus 30 is 80.
Group2: 30 plus 20 plus 30 is 80.
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.