of 54
7/25/2019 Fu Ch10 Categorical
1/54
EPI809/Spring 2008EPI809/Spring 2008 11
Chapter 10Chapter 10
Hypothesis testing: CategoricalHypothesis testing: Categorical
Data AnalysisData Analysis
7/25/2019 Fu Ch10 Categorical
2/54
EPI809/Spring 2008 2
Learning !"ecti#esLearning !"ecti#es
1$1$ Co%parison o& !ino%ial proportion 'sing ( an)Co%parison o& !ino%ial proportion 'sing ( an)
22*est$*est$
2$2$ E+plainE+plain 22*est &or In)epen)ence o& 2 #aria!les*est &or In)epen)ence o& 2 #aria!les,$,$ E+plain *he -isher.s test &or in)epen)enceE+plain *he -isher.s test &or in)epen)ence
$$ ce%ar.s tests &or correlate) )atace%ar.s tests &or correlate) )ata
$$ 3appa Statistic3appa Statistic
4$4$ 5se o& SAS Proc -6E75se o& SAS Proc -6E7
7/25/2019 Fu Ch10 Categorical
3/54
EPI809/Spring 2008 3
Data *ypesData *ypes
Data
Quantitative Qualitative
Discrete Continuous
Data
Quantitative Qualitative
Discrete Continuous
7/25/2019 Fu Ch10 Categorical
4/54
EPI809/Spring 2008 4
7'alitati#e Data7'alitati#e Data
1$1$ 7'alitati#e 6an)o% aria!les iel)7'alitati#e 6an)o% aria!les iel)6esponses *hat Can e P't In Categories$6esponses *hat Can e P't In Categories$E+a%ple: ;en)er E+a%ple: ;en)er
2$2$ eas're%ent or Co'nt 6e&lect ? in Categoryeas're%ent or Co'nt 6e&lect ? in Category
,$,$ o%inal or r)inal Scale o%inal or r)inal Scale
$$ Data can !e collecte) as contin'o's !'tData can !e collecte) as contin'o's !'t
reco)e) to categorical )ata$ E+a%plereco)e) to categorical )ata$ E+a%pleor%al tension= hypertension >
7/25/2019 Fu Ch10 Categorical
5/54
EPI809/Spring 2008 5
Hypothesis *estsHypothesis *ests
7'alitati#e Data7'alitati#e DataQualitative
Data
Z Test Z Test 2 Test
Proportion Independence1 pop.
2 Test
2 or morepop.
2 pop.
Qualitative
Data
Z Test Z Test 2 Test
Proportion Independence1 pop.
2 Test
2 or morepop.
2 pop.
7/25/2019 Fu Ch10 Categorical
6/54
EPI809/Spring 2008EPI809/Spring 2008 44
( *est &or Di&&erences in( *est &or Di&&erences in
*o Proportions*o Proportions
7/25/2019 Fu Ch10 Categorical
7/54
EPI809/Spring 2008 7
Hypotheses &orHypotheses &or
*o*oProportionsProportions
7/25/2019 Fu Ch10 Categorical
8/54
EPI809/Spring 2008 8
Hypotheses &orHypotheses &or
*o*oProportionsProportions
Research Questions
Hypothesis
No Dierence
!ny Dierence
Pop 1
Pop 2
Pop 1 " Pop 2
Pop 1 Pop 2
Pop 1 # Pop 2
H$
Ha
Research Questions
Hypothesis
No Dierence
!ny Dierence
Pop 1
Pop 2
Pop 1 " Pop 2
Pop 1 Pop 2
Pop 1 # Pop 2
H$
Ha
7/25/2019 Fu Ch10 Categorical
9/54
EPI809/Spring 2008 9
Hypotheses &orHypotheses &or
*o*oProportionsProportions
Research Questions
Hypothesis
No Dierence
!ny Dierence
Pop 1
Pop 2
Pop 1 " Pop 2
Pop 1 Pop 2
Pop 1 # Pop 2
H$ p1%p2 & $
Ha p1%p2 $
Research Questions
Hypothesis
No Dierence
!ny Dierence
Pop 1
Pop 2
Pop 1 " Pop 2
Pop 1 Pop 2
Pop 1 # Pop 2
H$ p1%p2 & $
Ha p1%p2 $
7/25/2019 Fu Ch10 Categorical
10/54
EPI809/Spring 2008 10
Hypotheses &orHypotheses &or
*o*oProportionsProportions
Research Questions
Hypothesis
No Dierence
!ny Dierence
Pop 1
Pop 2
Pop 1 " Pop 2
Pop 1 Pop 2
Pop 1 # Pop 2
H$ p1%p2 & $ p1%p2 $
Ha p1%p2 $ p1%p2 " $
Research Questions
Hypothesis
No Dierence
!ny Dierence
Pop 1
Pop 2
Pop 1 " Pop 2
Pop 1 Pop 2
Pop 1 # Pop 2
H$ p1%p2 & $ p1%p2 $
Ha p1%p2 $ p1%p2 " $
7/25/2019 Fu Ch10 Categorical
11/54
EPI809/Spring 2008 11
Hypotheses &orHypotheses &or
*o*oProportionsProportions
Research Questions
Hypothesis
No Dierence
!ny Dierence
Pop 1
Pop 2
Pop 1 " Pop 2
Pop 1 Pop 2
Pop 1 # Pop 2
H$ p1%p2 & $ p1%p2 $ p1%p2 $
Ha p1%p2 $ p1%p2 " $ p1%p2# $
Research Questions
Hypothesis
No Dierence
!ny Dierence
Pop 1
Pop 2
Pop 1 " Pop 2
Pop 1 Pop 2
Pop 1 # Pop 2
H$ p1%p2 & $ p1%p2 $ p1%p2 $
Ha p1%p2 $ p1%p2 " $ p1%p2# $
7/25/2019 Fu Ch10 Categorical
12/54
EPI809/Spring 2008 12
Hypotheses &orHypotheses &or
*o*oProportionsProportions
Research Questions
Hypothesis
No Dierence
!ny Dierence
Pop 1
Pop 2
Pop 1 " Pop 2
Pop 1 Pop 2
Pop 1 # Pop 2
H$ p1%p2 & $ p1%p2 $ p1%p2 $
Ha p1%p2 $ p1%p2 " $ p1%p2# $
Research Questions
Hypothesis
No Dierence
!ny Dierence
Pop 1
Pop 2
Pop 1 " Pop 2
Pop 1 Pop 2
Pop 1 # Pop 2
H$ p1%p2 & $ p1%p2 $ p1%p2 $
Ha p1%p2 $ p1%p2 " $ p1%p2# $
7/25/2019 Fu Ch10 Categorical
13/54
EPI809/Spring 2008 13
( *est &or Di&&erence in *o( *est &or Di&&erence in *o
ProportionsProportions1$1$ Ass'%ptionsAss'%ptions Pop'lations Are In)epen)entPop'lations Are In)epen)ent
Pop'lations -ollo ino%ial Distri!'tionPop'lations -ollo ino%ial Distri!'tion or%al Appro+i%ation Can e 5se) &oror%al Appro+i%ation Can e 5se) &or
large sa%pleslarge sa%ples >
2$2$ (@*est Statistic &or *o Proportions(@*est Statistic &or *o Proportions( ) ( )
( ) 21
21
21
2121 where
111
nn
XXp
nnpp
ppppZ
++
=
+
( ) ( )
( ) 21
21
21
2121 where
111
nn
XXp
nnpp
ppppZ
++
=
+
7/25/2019 Fu Ch10 Categorical
14/54
EPI809/Spring 2008 14
Sa%ple Distri!'tion &or Di&&erenceSa%ple Distri!'tion &or Di&&erence
eteen Proportionseteen Proportions
( ) ( )1 1 2 21 2 1 2
1 2
0 1 2
1 2
1 2
1 2
1 1 N ;
1 1N 0; :
,
p p p pp p p p
n n
pq under H p pn n
x xp
n n
+
+ =
+=
+
2 2
1 2
1 2 1 2
1 2
~ N ;X Xn n
+
7/25/2019 Fu Ch10 Categorical
15/54
EPI809/Spring 2008 15
( *est &or *o Proportions( *est &or *o Proportions
*hinBing Challenge*hinBing Challenge
o'.re an epi)e%iologist &or the 5So'.re an epi)e%iologist &or the 5S
Depart%ent o& Health an) H'%anDepart%ent o& Health an) H'%an
Ser#ices$ o'.re st')ying theSer#ices$ o'.re st')ying thepre#alence o& )isease in topre#alence o& )isease in to
states $ Instates $ In '!'!== ()()o&o&
1*$$1*$$people s'r#eye) erepeople s'r#eye) ere
)isease) an) in)isease) an) in C!C!== 12+12+ o&o& 1*$$1*$$
ere )isease)$ Atere )isease)$ At .$*.$*le#el= )oesle#el= )oes
'!'!ha#e aha#e a lo,erlo,erpre#alence ratepre#alence rate
'!
C!
7/25/2019 Fu Ch10 Categorical
16/54
EPI809/Spring 2008 16
( *est &or *o Proportions( *est &or *o Proportions
Sol'tionSol'tion
7/25/2019 Fu Ch10 Categorical
17/54
EPI809/Spring 2008 17
Test -tatisticTest -tatistic
DecisionDecision
ConclusionConclusion
( *est &or *o Proportions( *est &or *o Proportions
Sol'tionSol'tion
HH$$
HHaa
&&
nn'!'!&& nnC!C!&&
Critical /alue0sCritical /alue0s
7/25/2019 Fu Ch10 Categorical
18/54
EPI809/Spring 2008 18
Test -tatisticTest -tatistic
DecisionDecision
ConclusionConclusion
( *est &or *o Proportions( *est &or *o Proportions
Sol'tionSol'tion
HH$$pp'!'!%%ppC!C!& $& $
HHaapp'!'!%%ppC!C!" $" $
&&nn'!'!&& nnC!C!&&
Critical /alue0sCritical /alue0s
7/25/2019 Fu Ch10 Categorical
19/54
EPI809/Spring 2008 19
Test -tatisticTest -tatistic
DecisionDecision
ConclusionConclusion
( *est &or *o Proportions( *est &or *o Proportions
Sol'tionSol'tion
HH$$pp'!'!%%ppC!C!& $& $
HHaapp'!'!%%ppC!C!" $" $
&&.$*.$*nn'!'!&& 1*$$1*$$ nnC!C!&& 1*$$1*$$
Critical /alue0sCritical /alue0s
7/25/2019 Fu Ch10 Categorical
20/54
EPI809/Spring 2008 20
Test -tatisticTest -tatistic
DecisionDecision
ConclusionConclusion
( *est &or *o Proportions( *est &or *o Proportions
Sol'tionSol'tion
HH$$pp'!'!%%ppC!C!& $& $
HHaapp'!'!%%ppC!C!" $" $
&&.$*.$*nn'!'!&&1*$$1*$$ nnC!C!&&1*$$1*$$
Critical /alue0sCritical /alue0s
(0@1$4/2
$02
6e"ect
(0@1$4/2
$02
6e"ect
7/25/2019 Fu Ch10 Categorical
21/54
EPI809/Spring 2008 21
( *est &or *o Proportions( *est &or *o Proportions
Sol'tionSol'tion
( ) ( )
( ) ( )
00.4
1500
1
1500
10677.10677.
00860.0493.
0677.15001500
12974
0860.1500
1290493.
1500
74
=
+
=++=
++=
======
Z
nn
XXp
n
Xp
n
Xp
CAMA
CAMA
CA
CACA
MA
MAMA
( ) ( )
( ) ( )
00.4
1500
1
1500
10677.10677.
00860.0493.
0677.15001500
12974
0860.1500
1290493.
1500
74
=
+
=++=
++=
======
Z
nn
XXp
n
Xp
n
Xp
CAMA
CAMA
CA
CACA
MA
MAMA
7/25/2019 Fu Ch10 Categorical
22/54
EPI809/Spring 2008 22
Z & %).$$Z & %).$$
( *est &or *o Proportions( *est &or *o Proportions
Sol'tionSol'tion
HH$$pp'!'!%%ppC!C!& $& $
HHaapp'!'!%%ppC!C!" $" $
&&
.$*.$*
nn'!'!&& 1*$$1*$$ nnC!C!&&1*$$1*$$
Critical /alue0sCritical /alue0s
Test -tatisticTest -tatistic
DecisionDecision
ConclusionConclusion
(0@1$4/2
$02
6e"ect
(0@1$4/2
$02
6e"ect
7/25/2019 Fu Ch10 Categorical
23/54
EPI809/Spring 2008 23
Z & %).$$Z & %).$$
( *est &or *o Proportions( *est &or *o Proportions
Sol'tionSol'tion
HH$$pp'!'!%%ppC!C!& $& $
HHaapp'!'!%%ppC!C!" $" $
&&
.$*
.$*
nn'!'!&& 1*$$1*$$ nnC!C!&&1*$$1*$$
Critical /alue0sCritical /alue0s
Test -tatisticTest -tatistic
DecisionDecision
ConclusionConclusion
(0@1$4/2
$02
6e"ect
(0@1$4/2
$02
6e"ect Reect atReect at & .$*& .$*
7/25/2019 Fu Ch10 Categorical
24/54
EPI809/Spring 2008 24
Z & %).$$Z & %).$$
( *est &or *o Proportions( *est &or *o Proportions
Sol'tionSol'tion
HH$$pp'!'!%%ppC!C!& $& $
HHaapp'!'!%%ppC!C!" $" $
&&
.$*.$*
nn'!'!&&1*$$1*$$ nnC!C!&&1*$$1*$$
Critical /alue0sCritical /alue0s
Test -tatisticTest -tatistic
DecisionDecision
ConclusionConclusion
(0@1$4/2
$02
6e"ect
(0@1$4/2
$02
6e"ect Reect atReect at & .$*& .$*
There is evidence '!There is evidence '!
is less than C!is less than C!
7/25/2019 Fu Ch10 Categorical
25/54
7/25/2019 Fu Ch10 Categorical
26/54
EPI809/Spring 2008 26
Hypothesis *estsHypothesis *ests
7'alitati#e Data7'alitati#e DataQualitative
Data
Z Test Z Test 2 Test
Proportion Independence1 pop.
2 Test
2 or morepop.
2 pop.
Qualitative
Data
Z Test Z Test 2 Test
Proportion Independence1 pop.
2 Test
2 or morepop.
2 pop.
7/25/2019 Fu Ch10 Categorical
27/54
EPI809/Spring 2008 27
22*est o& In)epen)ence*est o& In)epen)ence
1$1$Shos I& a 6elationship E+ists eteen 2Shos I& a 6elationship E+ists eteen 2
7'alitati#e aria!les= !'t )oes7'alitati#e aria!les= !'t )oes NotNotShoSho
Ca'salityCa'sality
2$2$Ass'%ptionsAss'%ptions
'ltino%ial E+peri%ent'ltino%ial E+peri%ent
All E+pecte) Co'ntsAll E+pecte) Co'nts
,$,$5ses *o@Fay Contingency *a!le5ses *o@Fay Contingency *a!le
7/25/2019 Fu Ch10 Categorical
28/54
EPI809/Spring 2008 28
22*est o& In)epen)ence*est o& In)epen)enceContingency *a!leContingency *a!le
1$1$ Shos ? !ser#ations -ro% 1 Sa%pleShos ? !ser#ations -ro% 1 Sa%ple
Gointly in 2 7'alitati#e aria!lesGointly in 2 7'alitati#e aria!les
7/25/2019 Fu Ch10 Categorical
29/54
EPI809/Spring 2008 29
22*est o& In)epen)ence*est o& In)epen)enceContingency *a!leContingency *a!le
1$1$Shos ? !ser#ations -ro% 1 Sa%pleShos ? !ser#ations -ro% 1 Sa%ple
Gointly in 2 7'alitati#e aria!lesGointly in 2 7'alitati#e aria!les
3evels o varia4le 23evels o varia4le 2
3evels o varia4le 13evels o varia4le 1
7/25/2019 Fu Ch10 Categorical
30/54
EPI809/Spring 2008 30
22*est o& In)epen)ence*est o& In)epen)enceHypotheses StatisticHypotheses Statistic
1$1$HypothesesHypotheses HH00: aria!les Are In)epen)ent: aria!les Are In)epen)ent
HHaa: aria!les Are 6elate) : aria!les Are 6elate)
7/25/2019 Fu Ch10 Categorical
31/54
EPI809/Spring 2008 31
22*est o& In)epen)ence*est o& In)epen)enceHypotheses StatisticHypotheses Statistic
1$1$HypothesesHypotheses
HH00: aria!les Are In)epen)ent: aria!les Are In)epen)ent
HHaa: aria!les Are 6elate) : aria!les Are 6elate)
2$2$*est Statistic*est Statistic 54served count54served count
67pected67pected
countcount
2
2
=
n E n
E n
ij ij
ij
c h
c hall cells
2
2
=
n E n
E n
ij ij
ij
c h
c hall cells
7/25/2019 Fu Ch10 Categorical
32/54
EPI809/Spring 2008 32
22*est o& In)epen)ence*est o& In)epen)enceHypotheses StatisticHypotheses Statistic
1$1$HypothesesHypotheses
HH00: aria!les Are In)epen)ent: aria!les Are In)epen)ent
HHaa: aria!les Are 6elate) : aria!les Are 6elate)
2$2$*est Statistic*est Statistic
Degrees o& -ree)o%: Ro,sRo,s ColumnsColumns
54served count54served count
67pected67pected
countcount
2
2
=
n E n
E n
ij ij
ij
c h
c hall cells
2
2
=
n E n
E n
ij ij
ij
c h
c hall cells
7/25/2019 Fu Ch10 Categorical
33/54
EPI809/Spring 2008 33
22*est o& In)epen)ence*est o& In)epen)ence
E+pecte) Co'ntsE+pecte) Co'nts1$1$Statistical In)epen)ence eans GointStatistical In)epen)ence eans GointPro!a!ility E'als Pro)'ct o& arginalPro!a!ility E'als Pro)'ct o& arginal
Pro!a!ilitiesPro!a!ilities
2$2$Co%p'te arginal Pro!a!ilities 'ltiplyCo%p'te arginal Pro!a!ilities 'ltiply
&or Goint Pro!a!ility&or Goint Pro!a!ility
,$,$E+pecte) Co'nt Is Sa%ple SiJe *i%esE+pecte) Co'nt Is Sa%ple SiJe *i%es
Goint Pro!a!ilityGoint Pro!a!ility
7/25/2019 Fu Ch10 Categorical
34/54
EPI809/Spring 2008 34
E+pecte) Co'nt E+a%pleE+pecte) Co'nt E+a%ple
7/25/2019 Fu Ch10 Categorical
35/54
EPI809/Spring 2008 35
E+pecte) Co'nt E+a%pleE+pecte) Co'nt E+a%ple
112112
18$18$'ar9inal pro4a4ility &'ar9inal pro4a4ility &
7/25/2019 Fu Ch10 Categorical
36/54
EPI809/Spring 2008 36
E+pecte) Co'nt E+a%pleE+pecte) Co'nt E+a%ple
112112
18$18$
(:(:
18$18$
'ar9inal pro4a4ility &'ar9inal pro4a4ility &
'ar9inal pro4a4ility &'ar9inal pro4a4ility &
7/25/2019 Fu Ch10 Categorical
37/54
EPI809/Spring 2008 37
E+pecte) Co'nt E+a%pleE+pecte) Co'nt E+a%ple
112112
18$18$
(:(:
18$18$
'ar9inal pro4a4ility &'ar9inal pro4a4ility &
'ar9inal pro4a4ility &'ar9inal pro4a4ility &
;oint pro4a4ility &;oint pro4a4ility &112112
18$18$(:(:
18$18$
7/25/2019 Fu Ch10 Categorical
38/54
EPI809/Spring 2008 38
E+pecte) Co'nt E+a%pleE+pecte) Co'nt E+a%ple
112112
18$18$
(:(:
18$18$
'ar9inal pro4a4ility &'ar9inal pro4a4ility &
'ar9inal pro4a4ility &'ar9inal pro4a4ility &
;oint pro4a4ility &;oint pro4a4ility &112112
18$18$(:(:
18$18$
67pected count & 18$
7/25/2019 Fu Ch10 Categorical
39/54
EPI809/Spring 2008 39
E+pecte) Co'nt Calc'lationE+pecte) Co'nt Calc'lation
7/25/2019 Fu Ch10 Categorical
40/54
EPI809/Spring 2008 40
E+pecte) Co'nt Calc'lationE+pecte) Co'nt Calc'lation
67pected count &Ro, total Column total
-ample si=e
67pected count &Ro, total Column total
-ample si=e
7/25/2019 Fu Ch10 Categorical
41/54
EPI809/Spring 2008 41
E+pecte) Co'nt Calc'lationE+pecte) Co'nt Calc'lation
1127:21127:2
18$18$
):7(:):7(:
18$18$
):7:2):7:2
18$18$
1127(:1127(:
18$18$
67pected count &Ro, total Column total
-ample si=e
67pected count &Ro, total Column total
-ample si=e
7/25/2019 Fu Ch10 Categorical
42/54
EPI809/Spring 2008 42
o' ran)o%ly sa%pleo' ran)o%ly sa%ple 2:82:8se+'ally acti#ese+'ally acti#e
in)i#i)'als an) collect in&or%ation on their HIin)i#i)'als an) collect in&or%ation on their HI
stat's an) History o& S*Ds$ At thestat's an) History o& S*Ds$ At the .$*.$*le#el= isle#el= is
there e#i)ence o& athere e#i)ence o& a relationshiprelationship
22*est o& In)epen)ence*est o& In)epen)enceE+a%ple on HIE+a%ple on HI
7/25/2019 Fu Ch10 Categorical
43/54
EPI809/Spring 2008 43
22*est o& In)epen)ence*est o& In)epen)enceSol'tionSol'tion
7/25/2019 Fu Ch10 Categorical
44/54
EPI809/Spring 2008 44
22*est o& In)epen)ence*est o& In)epen)ence
Sol'tionSol'tion
HH$$
HHaa
&&
d &d &
Critical /alue0sCritical /alue0s
Test -tatisticTest -tatistic
DecisionDecision
ConclusionConclusion
2$
Reect
2$
Reect
2 * t & I ) )
7/25/2019 Fu Ch10 Categorical
45/54
EPI809/Spring 2008 45
22*est o& In)epen)ence*est o& In)epen)enceSol'tionSol'tion
HH$$ No RelationshipNo Relationship
HHaa RelationshipRelationship
&&
d &d &
Critical /alue0sCritical /alue0s
Test -tatisticTest -tatistic
DecisionDecision
ConclusionConclusion
2$
Reect
2$
Reect
22 &* t & I ) )
7/25/2019 Fu Ch10 Categorical
46/54
EPI809/Spring 2008 46
22*est o& In)epen)ence*est o& In)epen)enceSol'tionSol'tion
HH$$ No RelationshipNo Relationship
HHaa RelationshipRelationship
&& .$*.$*
d &d & 02 % 102 % 1 & 102 % 102 % 1 & 1
Critical /alue0sCritical /alue0s
Test -tatisticTest -tatistic
DecisionDecision
ConclusionConclusion
2$
Reect
2$
Reect
22 * & I ) )* t & I ) )
7/25/2019 Fu Ch10 Categorical
47/54
EPI809/Spring 2008 47
22*est o& In)epen)ence*est o& In)epen)enceSol'tionSol'tion
HH$$ No RelationshipNo Relationship
HHaa RelationshipRelationship
&& .$*.$*
d &d & 02 % 102 % 1 & 102 % 102 % 1 & 1
Critical /alue0sCritical /alue0s
Test -tatisticTest -tatistic
DecisionDecision
ConclusionConclusion
2$ >.:)1
Reect
2$ >.:)1
Reect & .$*& .$*
22 * t & I ) )* t & I ) )
7/25/2019 Fu Ch10 Categorical
48/54
EPI809/Spring 2008 48
EE00nnijij* in all* in all
cellscells
1($71>21($71>2
2:82:81($71*)1($71*)
2:82:8
11871>211871>2
2:82:81*)71181*)7118
2:82:8
22*est o& In)epen)ence*est o& In)epen)enceSol'tionSol'tion
22 * t & I ) )* t & I ) )
7/25/2019 Fu Ch10 Categorical
49/54
EPI809/Spring 2008 49
2
2
11 11
2
11
12 12
2
12
22 22
2
22
2 2 2:) *> *
*> *
>2 82 *
82 *
122 +1*
+1**) 2+
=
=
=
=
n E n
E n
n E n
E n
n E n
E n
n E n
E n
ij ij
ij
.
.
.
.
.
..
c hc h
a fa f
a fa f
a fa f
all cells
2
2
11 11
2
11
12 12
2
12
22 22
2
22
2 2 2:) *> *
*> *
>2 82 *
82 *
122 +1*
+1**) 2+
=
=
=
=
n E n
E n
n E n
E n
n E n
E n
n E n
E n
ij ij
ij
.
.
.
.
.
..
c hc h
a fa f
a fa f
a fa f
all cells
22*est o& In)epen)ence*est o& In)epen)enceSol'tionSol'tion
22 * t & I ) )* t & I ) )
7/25/2019 Fu Ch10 Categorical
50/54
EPI809/Spring 2008 50
22*est o& In)epen)ence*est o& In)epen)enceSol'tionSol'tion
HH$$ No RelationshipNo Relationship
HHaa RelationshipRelationship
& .$*& .$*
dd& 02 % 102 % 1 & 1& 02 % 102 % 1 & 1
Critical /alue0sCritical /alue0s
Test -tatisticTest -tatistic
DecisionDecision
ConclusionConclusion
2$ >.:)1
Reect
2$ >.:)1
Reect & .$*& .$*
22& *).2+& *).2+
22 * t & I ) )* t & I ) )
7/25/2019 Fu Ch10 Categorical
51/54
EPI809/Spring 2008 51
22*est o& In)epen)ence*est o& In)epen)enceSol'tionSol'tion
HH$$ No RelationshipNo Relationship
HHaa RelationshipRelationship
& .$*& .$*
dd& 02 % 102 % 1 & 1& 02 % 102 % 1 & 1
Critical /alue0sCritical /alue0s
Test -tatisticTest -tatistic
DecisionDecision
ConclusionConclusionReect atReect at & .$*& .$*
2$ >.:)1
Reect
2$ >.:)1
Reect & .$*& .$*
22& *).2+& *).2+
22 * t & I ) )* t & I ) )
7/25/2019 Fu Ch10 Categorical
52/54
EPI809/Spring 2008 52
22*est o& In)epen)ence*est o& In)epen)enceSol'tionSol'tion
HH$$ No RelationshipNo Relationship
HHaa RelationshipRelationship
& .$*& .$*
dd& 02 % 102 % 1 & 1& 02 % 102 % 1 & 1
Critical /alue0sCritical /alue0s
Test -tatisticTest -tatistic
DecisionDecision
ConclusionConclusionReect atReect at & .$*& .$*
There is evidence o aThere is evidence o a
relationshiprelationship
2$ >.:)1
Reect
2$ >.:)1
Reect & .$*& .$*
22& *).2+& *).2+
7/25/2019 Fu Ch10 Categorical
53/54
EPI809/Spring 2008 53
22*est o& In)epen)ence*est o& In)epen)enceSAS CDESSAS CDES
DataData)isK)isK
inp't S*Ds HI co'ntKinp't S*Ds HI co'ntK
car)sKcar)sK
1 1 81 1 8
1 2 ,21 2 ,2
2 1 82 1 82 2 1222 2 122
KK
runrunKK
ProcProcre?re?)ata)is or)er)ataK)ata)is or)er)ataK eight Co'ntKeight Co'ntK
ta!les S*DsHI/ta!les S*DsHI/chischisKK
runrunKK
7/25/2019 Fu Ch10 Categorical
54/54
22*est o& In)epen)ence*est o& In)epen)enceSAS 5*P5*SAS 5*P5*
Statistics for Table of STDs by HIV
Statistic DF Value Prob
-------------------------------------------------------Chi-Square 154.150 !.0001 "i#elihoo$ %atio Chi-Square 1 55.&'( !.0001 Co)ti)uity *$+. Chi-Square 1 5.,'&1 !.0001 a)tel-Hae)sel Chi-Square 1 5,./(0/ !.0001 Phi Coefficie)t 0.4,51
Co)ti)e)cy Coefficie)t 0.,//0 Craer2s V 0.4,51