Steply

Chi-square goodness of fit: observed 160, 25, 15; expected 70%, 20%…

Step by step, with the reason for every step · Chi-square · University Statistics

Step by step

The question

Question: we saw the counts 160, 25, 15, and expected 70%, 20%, 10%: at the 5% level, do the data fit?

observed 160, 25, 15; expected 70%, 20%, 10%; α = 0.05

1 Write the hypotheses

H₀ is the "nothing new" idea.

Here: the data fit the expected parts.

H0 : the data fit the expected parts

Hₐ is what we want to show.

Here: the data do not fit.

Ha : the data do not fit

2 Expected counts

If H zero is true, each cell expects n times its part.

E = n × p (if H0 is true)

A: 200 times 0.7 is 140.

E(A) = 200 × 0.7 = 140

B: 200 times 0.2 is 40.

E(B) = 200 × 0.2 = 40

C: 200 times 0.1 is 20.

E(C) = 200 × 0.1 = 20

Every expected count is at least 5, so the test works.

all E at least 5: the test works

3 Each part

Chi-square adds up, for each cell, the observed minus the expected, squared, over the expected.

χ2 = add up all (O − E)2E

A table: each cell, what we saw, O, and what we expected, E.

160 minus 140 is 20.

Squared, 400.

Over 140: 2.8571.

25 minus 40 is −15.

Squared, 225.

Over 40: 5.625.

15 minus 20 is −5.

Squared, 25.

Over 20: 1.25.

Careful!

We always divide by the expected count, not the observed one.

Careful: divide by E (expected), not by O

4 Add them

2.8571 plus 5.625 plus 1.25 is 9.7321.

χ2 = 2.8571 + 5.625 + 1.25 = 9.7321

5 The cut-off

df is the number of cells minus 1: 3 minus 1 is 2.

df = k − 1 = 3 − 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.

6 Decide

The chi-square curve for df 2.

Past the cut-off, 5.991, is the reject part.

9.7321 is past the cut-off.

So we reject H zero.

= χ2 = 9.7321 > 5.991 → reject H0

7 Say it in words

At the 5% level, there is enough evidence that

In words: at the 5% level, there is enough evidence that the data do not fit.

the data do not fit.

8 Check

Let's check: the expected counts add up to 200, like the observed ones.

E: 140 + 40 + 20 = 200 = n

And the differences O minus E add up to 0.

So it is right!

O − E: 20 + (−15) + (−5) = 0

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.

Answer
= χ2 = 9.7321 > 5.991 → reject H0

Your turn

Try this one yourself, then check:

observed 15, 160, 25; expected 10%, 70%, 20%; α = 0.05
Show the answer
reject H0

More from Chi-square

The whole lesson: Chi-square →