Steply

Chi-square independence: weekday 60 early 40 late, weekend 40 early…

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

Step by step

The question

Question: weekday: 60 early, 40 late; weekend: 40 early, 60 late: at the 1% level, is the answer linked to the group?

weekday: 60 early, 40 late; weekend: 40 early, 60 late; α = 0.01

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: weekday, 100; weekend, 100.

Each column's total: early, 100; late, 100.

And everyone: 200.

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

Weekday, early: 100 times 100, over 200, is 50.

= weekday, early: 100 × 100 ÷ 200 = 50

Weekday, late: 100 times 100, over 200, is 50.

= weekday, late: 100 × 100 ÷ 200 = 50

Weekend, early: 100 times 100, over 200, is 50.

= weekend, early: 100 × 100 ÷ 200 = 50

Weekend, late: 100 times 100, over 200, is 50.

= weekend, late: 100 × 100 ÷ 200 = 50

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.

60 minus 50 is 10.

Squared, 100.

Over 50: 2.

40 minus 50 is −10.

Squared, 100.

Over 50: 2.

40 minus 50 is −10.

Squared, 100.

Over 50: 2.

60 minus 50 is 10.

Squared, 100.

Over 50: 2.

5 Add them

2 plus 2 plus 2 plus 2 is 8.

χ2 = 2 + 2 + 2 + 2 = 8

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

Row 1, column .01: the cut-off is 6.635.

7 Decide

The chi-square curve for df 1.

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

8 is past the cut-off.

So we reject H zero.

= χ2 = 8 > 6.635 → reject H0

8 Say it in words

At the 1% level, there is enough evidence that

In words: at the 1% 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.

Weekday: 50 plus 50 is 100.

weekday: E 50 + 50 = 100 = 100

Weekend: 50 plus 50 is 100.

So it is right!

weekend: E 50 + 50 = 100 = 100

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 = 8 > 6.635 → reject H0

Your turn

Try this one yourself, then check:

weekday: 80 early, 121 late; weekend: 120 early, 80 late; α = 0.01
Show the answer
reject H0

More from Chi-square

The whole lesson: Chi-square →