Step by step
The question
Question: we saw the counts 18, 22, 20, 40, and expected equal parts: at the 5% level, do the data fit?
1 Write the hypotheses
H₀ is the "nothing new" idea.
Here: the data fit the expected parts.
Hₐ is what we want to show.
Here: the data do not fit.
2 Expected counts
If H zero is true, each cell expects n times its part.
Each cell: 100 times 1/4 is 25.
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.
18 minus 25 is −7.
Squared, 49.
Over 25: 1.96.
22 minus 25 is −3.
Squared, 9.
Over 25: 0.36.
20 minus 25 is −5.
Squared, 25.
Over 25: 1.
40 minus 25 is 15.
Squared, 225.
Over 25: 9.
Careful!
We always divide by the expected count, not the observed one.
4 Add them
1.96 plus 0.36 plus 1 plus 9 is 12.32.
5 The cut-off
df is the number of cells minus 1: 4 minus 1 is 3.
Chi-square is always a right-tail test: big means far from what we expected.
Row 3, column 0.05.
Row 3, column .05: the cut-off is 7.815.
6 Decide
The chi-square curve for df 3.
Past the cut-off, 7.815, is the reject part.
12.32 is past the cut-off.
So we reject H zero.
7 Say it in words
In words: at the 5% level, there is enough evidence that the data do not fit.
8 Check
Let's check: the expected counts add up to 100, 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.