Steply

Chi-square independence: plan 32 better 18 same, none 20 better 30…

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

Step by step

The question

Question: plan: 32 better, 18 same; none: 20 better, 30 same: at the 5% level, is the answer linked to the group?

plan: 32 better, 18 same; none: 20 better, 30 same; α = 0.05

1 Write the hypotheses

H₀ is the "nothing new" idea.

Here: the group and the answer are independent.

H0 : the group and the answer are independent

Hₐ is what we want to show.

Here: the group and the answer are not independent.

Ha : the group and the answer are not independent

Independent means no link: the answer does not depend on the group.

independent: no link, the answer does not depend on the group

2 Totals

The counts in a table.

Each row's total: plan, 50; none, 50.

Each column's total: better, 52; same, 48.

And everyone: 100.

3 Expected counts

If there is no link, each cell expects its row total times its column total, over the grand total.

E = row total × column totaltotal

Plan, better: 50 times 52, over 100, is 26.

= plan, better: 50 × 52 ÷ 100 = 26

Plan, same: 50 times 48, over 100, is 24.

= plan, same: 50 × 48 ÷ 100 = 24

None, better: 50 times 52, over 100, is 26.

= none, better: 50 × 52 ÷ 100 = 26

None, same: 50 times 48, over 100, is 24.

= none, same: 50 × 48 ÷ 100 = 24

4 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.

32 minus 26 is 6.

Squared, 36.

Over 26: 1.3846.

18 minus 24 is −6.

Squared, 36.

Over 24: 1.5.

20 minus 26 is −6.

Squared, 36.

Over 26: 1.3846.

30 minus 24 is 6.

Squared, 36.

Over 24: 1.5.

5 Add them

1.3846 plus 1.5 plus 1.3846 plus 1.5 is 5.7692.

χ2 = 1.3846 + 1.5 + 1.3846 + 1.5 = 5.7692

6 The cut-off

df is rows minus 1, times columns minus 1: 1 times 1 is 1.

df = (rows − 1)(columns − 1) = (2 − 1)(2 − 1) = 1

Careful!

Not the number of cells minus 1.

Rows minus 1, times columns minus 1: 1.

Careful: not df = 3 ✗

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

Row 1, column 0.05.

Row 1, column .05: the cut-off is 3.841.

7 Decide

The chi-square curve for df 1.

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

5.7692 is past the cut-off.

So we reject H zero.

= χ2 = 5.7692 > 3.841 → reject H0

8 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 group and the answer are not independent.

the group and the answer are not independent.

9 Check

Let's check: the expected counts give the same row totals.

Plan: 26 plus 24 is 50.

plan: E 26 + 24 = 50 = 50

None: 26 plus 24 is 50.

So it is right!

none: E 26 + 24 = 50 = 50

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.

Answer
= χ2 = 5.7692 > 3.841 → reject H0

Your turn

Try this one yourself, then check:

plan: 61 better, 40 same; none: 36 better, 65 same; α = 0.05
Show the answer
reject H0

More from Chi-square

The whole lesson: Chi-square →