Beruflich Dokumente
Kultur Dokumente
ASSOCIATION OF ATTRIBUTES
Chi-Square
MUHAMMAD USMAN
ROLL 553-07-09
11
Data Types
Data
Quantitative Qualitative
Continuous Discrete
22
Quantitative Data
Nominal Scale
Interval Scale
Ratio Scale
55
Nominal Scale
2
Tes
t
Proportio
n
Independenc
e
1
pop.
2
Tes
t
More
than
2 pop.
2
pop.
1010
ASSUMPTION
number of successes
sample size
x
p
n
Hypothesis for One Proportion
Ha
Hypothes
is
Research
Questions
No
Difference
Any
Difference
Pop 1
Pop
2
Pop 1 < Pop 2
Pop
1
Pop
2
Pop 1 > Pop
2
H0
1 2
0 p p
1 2
0 p p
1 2
0 p p
1 2
0 p p >
Z-Test Statistic for Two Proportions
( ) ( )
1 2 1 2
1 2
1 2
1 2
where
1 1
p p p p
X X
Z p
n n
pq
n n
+
+
_
+
,
Hypothesis for Two Proportions
Chi Square Test Basic Idea
1. Compares observed count to expected
count assuming null hypothesis is true
2. Closer observed count is to expected
count, the more likely the H0 is true
2. Test Statistic
( )
( )
2
2
all cells
i i
i
n E n
E n
1
]
2
0
Upper Tail
Area
D
F
.
99
5
.
9
5
.
0
5
1 .
.
.
0.0
04
3.8
41
2 0.0
10
0.1
03
5.9
91
2
()
If ni = E(ni), 2 0.
0
df = k - 1 = 2
5.9
91
Reject
H0
.05
Finding Critical Value
2 Test of Independence Example
As a realtor you want to determine if house style
and house location are related. At the .05 level of
significance, is there evidence of a relationship?
House Location
House Style Urban Rural Total
Split-Level 63 49 112
Ranch 15 33 48
Total 78 82 160
Shows number of observations from 1 sample
jointly in 2 qualitative variables
House Location
House Style Urban Rural Total
Split-Level 63 49 112
Ranch 15 33 48
Total 78 82 160
Levels of variable 2
Levels of variable 1
Chi Square Test of Independence
Contingencies Table
112
160
Marginal probability =
Expected Count Example
Location
Urban Rural
House Style Obs. Obs. Total
SplitLevel 63 49 112
Ranch 15 33 48
Total 78 82 160
78
160
Marginal probability =
Expected Count Example
112
160
Marginal probability =
Location
Urban Rural
House Style Obs. Obs. Total
SplitLevel 63 49 112
Ranch 15 33 48
Total 78 82 160
Expected Count Example
78
160
Marginal probability
=
112
160
Marginal probability =
Joint probability =
112
160
78
160
Location
Urban Rural
House Style Obs. Obs. Total
SplitLevel 63 49 112
Ranch 15 33 48
Total 78 82 160
Expected count = 160
112
160
78
160
= 54.6
Expected Count Calculation
i j
R C
=
n
ij
E
House
Location
Urb
an
Ru
ral
House
Style
O
bs
.
Ex
p.
O
bs
.
Ex
p.
Tot
al
Sp
lit
- Le
vel
6
3
11278
160
54
.6
4
9
11282
160
57
.4
1
1
2
Ran
ch
1
5
4878
160
23
.4
3
3
4882
160
24
.6
4
8
Tot
al
7
8
7
8
8
2
8
2
1
6
0
Eij 5 in all cells
2 Test of Independence
Solution
House Location
Urban Rural
House Style Obs. Exp. Obs. Exp. Total
Split-Level 63 54.6 49 57.4 112
Ranch 15 23.4 33 24.6 48
Total 78 78 82 82 160
11282
160
4878
160
4882
160
11278
160
[ ] [ ] [ ]
[ ] [ ] [ ]
2
2
all cells
2 2 2
11 11 12 12 22 22
11 12 22
2 2 2
63 54.6 49 57.4 33 24.6
8.41
54.6 57.4 24.6
ij ij
ij
n E
E
n E n E n E
E E E
1
]
+ + +
+ + +
L
L
2 Test of Independence
Solution
2 Test of Independence Solution
H0:
Ha:
df =
Critical Value(s):
Test Statistic:
p-value = ?
Decision:
Conclusion:
2 = 8.41
Reject at = .05
There is evidence of
a relationship
2
0
Reject
H0
No Relationship
Relationship
.05
(2 - 1)(2 - 1) = 1
3.84
1
.05
Yates Correction for Continuity
0 indicates no association