Steply

Chi-square independence: boys 22 sport 18 music 20 art, girls 18…

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

Step by step

The question

Question: boys: 22 sport, 18 music, 20 art; girls: 18 sport, 22 music, 20 art: at the 5% level, is the answer linked to the group?

boys: 22 sport, 18 music, 20 art; girls: 18 sport, 22 music, 20 art; α = 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: boys, 60; girls, 60.

Each column's total: sport, 40; music, 40; art, 40.

And everyone: 120.

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

Boys, sport: 60 times 40, over 120, is 20.

= boys, sport: 60 × 40 ÷ 120 = 20

Boys, music: 60 times 40, over 120, is 20.

= boys, music: 60 × 40 ÷ 120 = 20

Boys, art: 60 times 40, over 120, is 20.

= boys, art: 60 × 40 ÷ 120 = 20

Girls, sport: 60 times 40, over 120, is 20.

= girls, sport: 60 × 40 ÷ 120 = 20

Girls, music: 60 times 40, over 120, is 20.

= girls, music: 60 × 40 ÷ 120 = 20

Girls, art: 60 times 40, over 120, is 20.

= girls, art: 60 × 40 ÷ 120 = 20

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.

22 minus 20 is 2.

Squared, 4.

Over 20: 0.2.

18 minus 20 is −2.

Squared, 4.

Over 20: 0.2.

20 minus 20 is 0.

Squared, 0.

Over 20: 0.

18 minus 20 is −2.

Squared, 4.

Over 20: 0.2.

22 minus 20 is 2.

Squared, 4.

Over 20: 0.2.

20 minus 20 is 0.

Squared, 0.

Over 20: 0.

5 Add them

0.2 plus 0.2 plus 0 plus 0.2 plus 0.2 plus 0 is 0.8.

χ2 = 0.2 + 0.2 + 0 + 0.2 + 0.2 + 0 = 0.8

6 The cut-off

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

df = (rows − 1)(columns − 1) = (2 − 1)(3 − 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.

0.8 is not past the cut-off.

So we do not reject H zero.

= χ2 = 0.8 < 5.991 → do not reject H0

8 Say it in words

At the 5% level, there is not enough evidence that

In words: at the 5% level, there is not enough evidence that the group and the answer are not independent.

the group and the answer are not independent.

This does not prove H zero is true.

We just cannot rule it out.

not rejecting H0 does not prove H0

9 Check

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

Boys: 20 plus 20 plus 20 is 60.

boys: E 20 + 20 + 20 = 60 = 60

Girls: 20 plus 20 plus 20 is 60.

So it is right!

girls: E 20 + 20 + 20 = 60 = 60

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 = 0.8 < 5.991 → do not reject H0

Your turn

Try this one yourself, then check:

boys: 19 sport, 20 music, 22 art; girls: 23 sport, 21 music, 18 art; α = 0.05
Show the answer
do not reject H0

More from Chi-square

The whole lesson: Chi-square →