Step by step
The question
Question: a die is rolled 180 times, and the faces 1 to 6 come up 25, 35, 30, 20, 40, 30 times: at the 5% level, is the die fair?
1 Write the hypotheses
H₀ is the "nothing new" idea.
Here: the die is fair.
Hₐ is what we want to show.
Here: the die is not fair.
2 Expected counts
If H zero is true, each cell expects n times its part.
Each face: 180 times 1/6 is 30.
Every expected count is at least 5, so the test works.
3 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.
35 minus 30 is 5.
Squared, 25.
Over 30: 0.8333.
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.
30 minus 30 is 0.
Squared, 0.
Over 30: 0.
Careful!
We always divide by the expected count, not the observed one.
4 Add them
0.8333 plus 0.8333 plus 0 plus 3.3333 plus 3.3333 plus 0 is 8.3332.
5 The cut-off
df is the number of cells minus 1: 6 minus 1 is 5.
Chi-square is always a right-tail test: big means far from what we expected.
Row 5, column 0.05.
Row 5, column .05: the cut-off is 11.070.
6 Decide
The chi-square curve for df 5.
Past the cut-off, 11.070, is the reject part.
8.3332 is not past the cut-off.
So we do not reject H zero.
7 Say it in words
In words: at the 5% level, there is not enough evidence that the die is not fair.
This does not prove H zero is true.
We just cannot rule it out.
8 Check
Let's check: the expected counts add up to 180, like the observed ones.
And the differences O minus E add up to 0.
So it is right!
Let's look back.
First: write the hypotheses.
Then: expected counts.
Then: each part.
Then: add them.
Then: the cut-off.
Then: decide.
Then: say it in words.
Last: check.