You are on page 1of 12

16-1 of 12

Chapter Sixteen
Chi-Square Tests

16-2 of 12
McGraw-Hill/Irwin

Copyright 2003 by The McGraw-Hill Companies, Inc. All rights reserved.

Chi-Square tests
16.1 Chi-Square Goodness of Fit Tests
16.2 A Chi-Square Test for Independence

16-3 of 12

16.1 Example: Chi-Square


Goodness of Fit Test
Example 16.1 The Microwave Oven Preference Case
MegaStat Output
Goodness of Fit Test
observed
102
121
120
57
400

expected
80.000
140.000
120.000
60.000
400.000

8.78 chi-square
3 df
.0324 p-value

16-4 of 12

O - E (O - E) / E % of chisq
22.000
6.050
68.92
-19.000
2.579
29.37
0.000
0.000
0.00
-3.000
0.150
1.71
0.000
8.779
100.00

Are consumer
preferences for
microwave ovens in
Milwaukee the same as
those historically
observed in Cleveland?

C
l
e
v
e
l
a
n
dM
i
l
w
a
u
k
e
e
BrandM
a
r
k
e
t
S
h
a
r
eF
r
e
q
u
e
n
c
y
1
2
0
%
1
0
2
2
3
5
%
1
2
1
3
3
0
%
1
2
0
4 15% 57

A Goodness of Fit Test for Multinomial


Probabilities
Consider the outcome of a multinomial experiment where each of n
randomly selected items is classified into one of k groups and let
fi = number of items classified into group i (ith observed frequency)
Ei = npi = expected number in ith group if pi is probability of being in
group i (ith expected frequency)
To Test: H0: multinomial probabilities are p1, p2, , pk

Ha: at least one of the probabilities differs from p1, p2, , p


Test
Statistic:
Reject H0 if

( f i Ei ) 2
=
Ei
i 1
2

> or if p-value <

2 and the p-value are based on p-1 degrees of freedom. Values of


2 are given in Table A.17.
16-5 of 12

Example: Chi-Square Goodness of


Fit Test
Example 16.1 The Microwave Oven Preference Case
Ei npi f pi

H0: p1 = .20, p2 = .35, p3 = .30, p4 = .15

E1 400(0.20) 80

Ha: H0 fails to hold

C
l
e
v
e
l
a
n
dM
i
l
w
a
u
k
e
eE
x
p
e
c
t
e
d
i
B
r
a
n
dM
a
r
k
e
t
S
h
a
r
eF
r
e
q
u
e
n
c
yF
r
e
q
u
e
n
c
y
C
h
i
S
q
(f E )
1
2
0
%
1
0
2
8
0
6
.
0
5
0
0
=
2
3
5
%
1
2
1
1
4
0
2
.
5
7
8
6
E
3
3
0
%
1
2
0
1
2
0
0
.
0
0
0
0
4 15% 57 60 0
.8.1
5
0
0
(102 80) (121 140) (120 120) (57 60)
7786

i 1

80
140
120
6.0500 2.5786 0.0000 0.1500 8.7786

2 8.7786 7.8147 .205


p value P( 2 8.7786) 0.0324
16-6 of 12

60

Chi-Square Goodness of Fit for


Normal Distribution
Example 16.2 The Car Mileage Case

H0: car mileage data are random sample from normal population
Ha: data not from a normal population
16
14
Frequency

I
n
t
e
r
v
a
l
O
b
s
e
r
v
e
dE
x
p
e
c
t
e
d
2
Lo
w
e
rU
p
p
e
rF
r
e
q
u
e
n
c
yF
r
e
q
u
e
n
c
y(
f
E
)
/
E
2
9
.
7
53
0
.
3
5
3
3
.
2
7
3
2
0
.
0
2
2
8
3
0
.
3
53
0
.
9
5
9
7
.
8
3
0
2
0
.
1
7
4
8
3
0
.
9
53
1
.
5
5
1
2
1
3
.
3
9
6
6
0
.
1
4
5
6
3
1
.
5
53
2
.
1
5
1
3
1
3
.
3
9
6
6
0
.
0
1
1
7
3
2
.
1
53
2
.
7
5
9
7
.
8
3
0
2
0
.
1
7
4
8
.31753
3Chi-S
3q
.2
7
3
2
0
.
0
2
2
8
x3
2
.553
,.3
s5
0.8
uare 0.5525

12
10
8
6
4
2
0
30.05

30.65

31.25

31.85

32.45

33.05

Mileage (midpoints)
Observed

Expected

2 0.5525 7.8147 .205

p value P( 2 0.5525) 0.907


16-7 of 12

and the p-value are based on k-1-m = 6-1-2 = 3 degrees of


freedom.

16.2 Example: Chi-Square Test for


Independence
Example 16.3 The Client Satisfaction Case
Does investment client satisfaction depend upon investment fund
type?
MegaStat Output
SRating

FundType

BOND

16-8 of 12

Observed
Expected
STOCK Observed
Expected
TAXDEF Observed
Expected
Total
Observed
Expected

HIGH
15
12.00
24
12.00
1
16.00
40
40.00

MED
12
12.00
4
12.00
24
16.00
40
40.00

46.44 chi-square
4 df
2.00E-09 p-value

LOW
3
6.00
2
6.00
15
8.00
20
20.00

Total
30
30.00
30
30.00
40
40.00
100
100.00

A Chi-Square Test for Independence


Each of n randomly selected items is classified on two dimensions
into a contingency table with r rows an c columns and let
fij = observed cell frequency for ith row and jth column
ri = ith row total,
cj = jth column total
ri c j
E ij
expected cell frequency for ith row and jth column
undern
independence
To Test: H0: the two classifications statistically independent
Ha: the two classifications statistically dependent
Test
Statistic:
Reject H0 if

)2
(
f

E
ij
2= ij
E
all cells
ij

> or if p-value <


16-9 of 12

and the p-value are based on (r-1)(c-1) degrees of freedom.


Values of are given in Table A.17.

Example: Chi-Square Test for


Independence
Client Satisfaction
Fund High
Low
Med All
Bond
15
3
12
30
12
6
12
Stock
24
2
4
30
12
6
12
TaxDef
1
15
24
40
16
8
16
All
40
20
40 100

(f ij E ij )2
=
;

E
all cells
2

E BH

ij

Example 16.3
The Client Satisfaction Case
H0: client satisfaction is
independent of fund type
Ha: client satisfaction depends
upon fund type

rB cH (30)(40)
rc
(40)(40)

12, ... , ETM T M


16
n
100
n
100

(15 12) 2 (3 6) 2
(24 16) 2

...
12
6
16
0.7500 1.5000 ... 4.0000 46.4375

2 46.4375 9.4877 .205


p value
16-10 of 12

P( 2 46.4375) 0.0000

Example: Analysis of Classification


Dependencies
Client Satisfaction
Fund
High
Low
Med
All
Bond
15
3
12
30
50.00 10.00 40.00 100.00
Stock
24
2
4
30
80.00
6.67 13.33 100.00
TaxDef
1
15
24
40
2.50 37.50 60.00 100.00

Example 16.4
The Client Satisfaction Cas
2 46.4375 9.4877 .205
p value P( 2 46.4375) 0.0000

Row Percentages

Row Percentages versus Investment Type for each Satisfaction


Level

16-11 of 12

Chi-Square tests

16.1
16.2

16-12 of 12

Summary
:

Chi-Square Goodness of Fit Tests


A Chi-Square Test for Independence

You might also like