Chapter 6

Categorical Data and Chi-Square


Reminder about hypothesis testing:

Z-Test:

Binomial Test:

Chi-Square ( ch6-3 ) Test:

Legalize
Do No Legalize
Female
9
23
Male
9
7

The Chi-Square Distribution:

Hits
Outs
Observed
6
4
Expected?

ch6-4

In-Class Example:

Attempt
Expected (E)
Observed (0)
ch6-5
1
3 / 7
/
2
3 / 7
/
3
3 / 7
/
4
3 / 7
/
5
3 / 7
/
6
3 / 7
/
7
3 / 7
/
8
3 / 7
/
9
3 / 7
/
10
3 / 7
/

Continuing the Baseball Example:

Hits
Outs
Observed
6
4
Expected
3
7

ch6-8

ch6-9

ch6-10

ch6-11

The ch6-14 Table and Degrees of Freedom:

Going a Step Further:

Hit
Walk
HBP
Out
Observed
12
3
8
27
Expected

Using Chi-Square to test Independence:

Legalize
Do not Legalize
Female
9
23
Male
9
7
Legalize
Do Not Legalize
Total
Female
9
23
32
Male
9
7
16
Total
18
30
48
Legalize
Do Not Legalize
Total
Female
9
Expect: 13.5
23
Expect: 22.5
32
Male
9
Expect: 4.5
7
Expect: 7.5
16
Total
18
30
48

ch6-23

ch6-24

ch6-25

ch6-26

Degrees of Freedom for Two-Variable Contingency Tables

Assumptions of Chi-Square:

Activity
Low
Medium
High
3
7
10

A Tale of Tails

Option 1
Option 2
Option 3
38
57
5

Measures of Association


Smoking Behaviour

Nonsmoker
Smoker
Male
400
100
Female
350
150


Primary Food Shopper

Yes No
Male 400 100
Female 100 400

Cramer's Phi ( ch6-37 ) - a measure of association

ch6-38

Kappa (k) - a measure of agreement

Judge 1 (Steve)
Judge 2
Yuck!
OK
Yummy
Yuck!
3
2
3
OK
1
15
2
Yummy
0
1
3

ch6-41