Steply

Chi-square goodness of fit: observed 15, 25, 35, 45, 30; expected…

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

Step by step

The question

Question: we saw the counts 15, 25, 35, 45, 30, and expected equal parts: at the 2.5% level, do the data fit?

observed 15, 25, 35, 45, 30; expected equal parts; α = 0.025

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)

Each cell: 150 times 1/5 is 30.

E = 150 × 15 = 30

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.

15 minus 30 is −15.

Squared, 225.

Over 30: 7.5.

25 minus 30 is −5.

Squared, 25.

Over 30: 0.8333.

35 minus 30 is 5.

Squared, 25.

Over 30: 0.8333.

45 minus 30 is 15.

Squared, 225.

Over 30: 7.5.

30 minus 30 is 0.

Squared, 0.

Over 30: 0.

Careful!

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

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

4 Add them

7.5 plus 0.8333 plus 0.8333 plus 7.5 plus 0 is 16.6666.

χ2 = 7.5 + 0.8333 + 0.8333 + 7.5 + 0 = 16.6666

5 The cut-off

df is the number of cells minus 1: 5 minus 1 is 4.

df = k − 1 = 5 − 1 = 4

Chi-square is always a right-tail test: big means far from what we expected.

Row 4, column 0.025.

Row 4, column .025: the cut-off is 11.143.

6 Decide

The chi-square curve for df 4.

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

16.6666 is past the cut-off.

So we reject H zero.

= χ2 = 16.6666 > 11.143 → reject H0

7 Say it in words

At the 2.5% level, there is enough evidence that

In words: at the 2.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 150, like the observed ones.

E: 30 + 30 + 30 + 30 + 30 = 150 = n

And the differences O minus E add up to 0.

So it is right!

O − E: (−15) + (−5) + 5 + 15 + 0 = 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 = 16.6666 > 11.143 → reject H0

Your turn

Try this one yourself, then check:

observed 24, 45, 35, 16, 30; expected equal parts; α = 0.025
Show the answer
reject H0

More from Chi-square

The whole lesson: Chi-square →