2. Contingency Tables
{wo-Way Contingency Tat
Contingency table: cols contain counts of outeomes.
ee
‘A:wo-way table with I rows and J columns is eallod an I} sable.
pve
Physicians’ Health Study (5 years)
[Mycaral Infarction (Ml) = hoa attack. 2x 2 table.
cop
YW
Places TEE 108s
Aspirin 104 10933
With row totale:
Tow a
YN Tota
Pracebo a3 ToBI 10s
Asprin 104 1099311037 —
Diagnostic Disease Tests
Ye=outcome cttest: t=pustve 2 = negative
X-= actual condition’ 1 = diseased 2 = noldseased
Pry = 11K
Pry = 20k
senstvly
specticly
It you get a postive result, move relevant to yous Prix = 1Y
sisease is rolaively rare, his may below even it sensitvty and
spectity are high (see ep. 25-26 of text for an exam)
‘conditional dt von X rts to the probably
distibvion of wren we reste toon oad love ot X
Physicians’ Health Study (ctd)
wap
YW tera
Fete ast
Sample (or estimated) eondonal roe for plaebo group are
10 to.s45
rosa Tage
sea
Natural way to look at data when
—Y = response variable (0. heart stack: yes/no)
Indep. X= evplanaiony variable (8. eoup:aspiinacebo)
int and Marginal Distribution
‘What i and ¥ are both response variates? Let
ny =PIX=4Y=j, tat,
{rx] forms the joint alistebution ot X ard Y.
(ox }forms the marginat cistbution ot X.
{reforms the marginal estbuton ot Y.
2x Zexample:
x 1 ae]Sample col courts: {ny}
Cell proportions: (py)
Ips Wwnere
2x 2 example:
Fact: X and Yate independent
Pax =i,¥=j) = PAX =U
bo. my = mismey for alli and)
2x exam:
LL
x Ee
2 Dna
it and ont it
Pav
1
2
a
2
Tz
forall andj
é
Independence
Definition (Statistical Independence)
X and Y are stavsteal independent ithe vue conltonaldstriuton
Of Is the same at each lovel of X.
2 x 2 example, Rows represent condional étibuions of Y given X.
y
12
1 [erpas] 1
* 2 Torts} 1
2.2 Comparing Proportions in 2 x 2 Tables
y
s
Conditional itibutions x {P= TEs
fe =ps—pe SE lpr pe
Physicians’ Health Study (etd)
P)=0017 pe=0.008 p;—pe—0.008
DorrxOaeT oO x ORT
SE= Grose Froa7 20018
95% Clfor my me! .008 &: 1.96(.0018) ~.008 003 ~ (.005,.011
‘Apparently — mp > 0.8. 5 > 72)relative risk = 1 (Cm TF
Physicians’ Health Study (ctd)
Pas)
‘Sample relative rsk nthe Physicians Health Study is “Tho odds of response S (instead of Fs PS
py _ 9017 m
pe 0008 ~ '? in row
Inthe 2 « 2 table above:
odds(s) =
‘Sample proportion of heart atacks was 82% higher or placebo group Invow 2,
Soe p. 58 of loxl for Cl formula for relative risk Note
Example: 95% Cl for BR in PHSis(1.43,2.31 > if odds(S} = 8, then Sis tree times as key as F
Tndeperdonco <=> S=1 » if odds(} = 3, thon Fis three times as key as
i) st
1(s) = _OeestS) 1 ee
PS) = TF oaaaiST Group 3 Pe =
odds(s) <3 =» Pris) 2 put
a a Deion (Odds Ratlo) = rio
odds(s)=1 <> pris)- V3 -V8_1 pgp 3 mi(1—m)
IS) 5 = PIS m a 4 NG O8is Ratio: = BO