Steply

Chi-square independence: a 20 yes 30 no, b 25 yes 25 no, c 35 yes 15…

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

Step by step

The question

Question: a: 20 yes, 30 no; b: 25 yes, 25 no; c: 35 yes, 15 no: at the 5% level, is the answer linked to the group?

a: 20 yes, 30 no; b: 25 yes, 25 no; c: 35 yes, 15 no; α = 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: a, 50; b, 50; c, 50.

Each column's total: yes, 80; no, 70.

And everyone: 150.

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

A, yes: 50 times 80, over 150, is about 26.6667.

= a, yes: 50 × 80 ÷ 150 ≈ 26.6667

A, no: 50 times 70, over 150, is about 23.3333.

= a, no: 50 × 70 ÷ 150 ≈ 23.3333

B, yes: 50 times 80, over 150, is about 26.6667.

= b, yes: 50 × 80 ÷ 150 ≈ 26.6667

B, no: 50 times 70, over 150, is about 23.3333.

= b, no: 50 × 70 ÷ 150 ≈ 23.3333

C, yes: 50 times 80, over 150, is about 26.6667.

= c, yes: 50 × 80 ÷ 150 ≈ 26.6667

C, no: 50 times 70, over 150, is about 23.3333.

= c, no: 50 × 70 ÷ 150 ≈ 23.3333

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.

20 minus 26.6667 is −6.6667.

Squared, 44.4449.

Over 26.6667: 1.6667.

30 minus 23.3333 is 6.6667.

Squared, 44.4449.

Over 23.3333: 1.9048.

25 minus 26.6667 is −1.6667.

Squared, 2.7779.

Over 26.6667: 0.1042.

25 minus 23.3333 is 1.6667.

Squared, 2.7779.

Over 23.3333: 0.1191.

35 minus 26.6667 is 8.3333.

Squared, 69.4439.

Over 26.6667: 2.6041.

15 minus 23.3333 is −8.3333.

Squared, 69.4439.

Over 23.3333: 2.9762.

5 Add them

1.6667 plus 1.9048 plus 0.1042 plus 0.1191 plus 2.6041 plus 2.9762 is 9.3751.

χ2 = 1.6667 + 1.9048 + 0.1042 + 0.1191 + 2.6041 + 2.9762 = 9.3751

6 The cut-off

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

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

Careful!

Not the number of cells minus 1.

Rows minus 1, times columns minus 1: 2.

Careful: not df = 5 ✗

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.

7 Decide

The chi-square curve for df 2.

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

9.3751 is past the cut-off.

So we reject H zero.

= χ2 = 9.3751 > 5.991 → 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.

A: 26.6667 plus 23.3333 is 50.

a: E 26.6667 + 23.3333 = 50 = 50

B: 26.6667 plus 23.3333 is 50.

b: E 26.6667 + 23.3333 = 50 = 50

C: 26.6667 plus 23.3333 is 50.

So it is right!

c: E 26.6667 + 23.3333 = 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 = 9.3751 > 5.991 → reject H0

Your turn

Try this one yourself, then check:

a: 25 yes, 26 no; b: 36 yes, 15 no; c: 20 yes, 31 no; α = 0.05
Show the answer
reject H0

More from Chi-square

The whole lesson: Chi-square →