Two by Two
Two by Two
Two by Two
Kevin M. Sullivan, PhD, MPH, MHA, Associate Professor, Department of Epidemiology, Rollins School
of Public Health, Emory University, Atlanta, Georgia, USA
Table 15-1. Notation and table setup for a 2x2 The uncorrected chi square is calculated as
table
Exposed Nonexposed (n)( ad bc) 2
Disease a b m1 uncorr 12
n1 n0 m1m0
No Disease c d m0
n1 n0 n
and the Mantel Haenszel chi square as
1
Table 5.1. Estimates and confidence intervals for epidemiologic parameters for a single table
Parameter Point Estimate Variance Estimate Confidence Interval
Parameters based on risks (from randomized trials and cohort studies) or prevalences (cross-sectional studies)
Risk Ratio Rˆ e
Rˆ R
1 - R̂e 1 R̂u
Vaˆr (ln Rˆ R )
ˆ RRexp Z1 - /2 Vaˆr (ln RR)
ˆ
Rˆ u n1R̂e noR̂u
Risk Difference Rˆ D R̂e - Rˆ u Rˆ e(1 Rˆ e) Rˆ u(1 Rˆ u)
Vaˆr ( Rˆ D) Rˆ D Z 1 / 2 Vaˆr ( Rˆ D )
n1 n0
Etiologic Fraction Rˆ Rˆ u
in the Population EFˆp
Rˆ
Etiologic Fraction Rˆ e Rˆ u Based on variance estimate for the RR Rˆ RLB 1 Rˆ RUB 1
in the Exposed EFˆe LB= ;UB=
Rˆ e Rˆ RLB Rˆ RUB
Prevented Rˆ u Rˆ
Fraction in the PFˆ p
Population Rˆ u
Prevented Rˆ u R̂e Based on variance estimate for the RR LB= 1 Rˆ RUB ; UB= 1 Rˆ RLB
Fraction in the P Fˆ e
Exposed Rˆ u
Parameters based on the odds and odds ratio (from randomized trials, cohort studies, case-control, or cross-sectional
studies)
Odds Ratio ad 1 1 1 1 ˆ ˆ
Oˆ R Vaˆr (ln Oˆ R) ORexp Z1 - /2 Vaˆr (ln OR)
bc a b c d
Etiologic Fraction EFˆpOR
in the Population
p' (ORˆ 1)
p ' (ORˆ 1) 1
Etiologic Fraction Oˆ R 1 Based on variance estimate for the OR Oˆ RLB 1 Oˆ RUB 1
in the Exposed EFˆeOR LB= ;UB=
Oˆ R Oˆ RLB Oˆ RUB
Prevented PFˆpOR
Fraction in the
Population p ' (1 Oˆ R)
Prevented PFˆ eOR 1 Oˆ R Based on variance estimate for the OR LB= 1 Oˆ RUB ; UB= 1 Oˆ RLB
Fraction in the
Exposed
LB=lower bound; UB=upper bound
P’=…
Table 15-2. Example data; prevalence of anemia The Prevalence Ratio estimate is as follows (using the
in children 12-23.9 months of age by sex formulae for the risk ratio):
4
Parameter Point Estimate Confidence Interval
Risk Ratio – The link ed image cannot be displayed. The file may hav e been mov ed, renamed, or deleted. Verify that the link
po ints to the correct file and location.
Directly
Z 1 / 2
Adjusted Rˆ RDirect exp
s
wi
where i 1
The link ed image cannot be
displayed. The file may hav e
been mov ed, renamed, or
deleted. Verify that the link
po ints to the correct file and
location.
The link ed image cannot be displayed. The file may hav e been
mov ed, renamed, or deleted. Verify that the link points to the correct
Risk Ratio – a i noi s The link ed image cannot be displayed. The file may hav e been mov ed, renamed, or deleted. Verify that the link
po ints to the correct file and location.
Mantel- n where
Haenszel Rˆ RMH i s1 i
bi n1i s
Adjusted
i 1 ni
m 1i 1i n n0i a i bi ni / ni2
SE ln Rˆ RMH i 1
s ai n0i s bi n1i
i 1 ni i 1 ni
Risk s
Z
Difference – w Rˆ D i i Rˆ DDirect 1 / 2
s
Directly Rˆ DDirect i 1
s w i
Adjusted w
i 1
i
i 1
where
1 a b
wi , Rˆ Di i i
ai c i bi d i n1i n0i
3
3
n1i n0 i
Odds Ratio – s
Directly wi ln( Oˆ Ri )
Z
Adjusted Oˆ R Direct exp i 1 s Oˆ RDirect exp 1 / 2
s
wi
wi
i 1 i 1
where
ad 1
Oˆ Ri i i , wi
bi ci 1 1 1 1
ai bi ci di
Odds Ratio –
Mantel-
ai d i
s
Oˆ R MH exp Z1-/2 SE lnOˆ RMH
n where
Haenszel Oˆ RMH i s1 i
bi ci
Adjusted i 1 ni
5
SE lnOˆ RMH
s s s
Pi Ri
i 1
( Pi S i Qi Ri )
i 1
Q S
i 1
i i
2
s s
2
s 2 Ri S i s
2 Ri 2 S i
i 1 i 1
i 1 i 1
Pi ( ai di ) / ni
Qi (bi ci ) / ni
Ri ai di / ni
Si bi ci / ni
6
Tests for Interaction for the Risk Ratio, Risk Difference, and the Odds Ratio
The tests for interaction presented here are generally referred to as the “Breslow-
Day test of homogeneity” and are based on a chi square test.
The test for interaction for the risk ratio is:
s21
s ln Rˆ R ln Rˆ R
i Direct 2
i 1 ˆ
Vaˆr ln( RRi )
where the Var[ln(RRi)] = 1/wi from the direct RR point estimate calculation.
2
s Rˆ D Rˆ D
i Direct
2
s 1
i 1
ˆ
Vaˆr ( RDi )
where the Var(RDi) = 1/wi from the direct RD point estimate calculation.
To test for interaction for the odds ratio (OR), the chi square test is calculated as:
2
i
s ln Oˆ R ln Oˆ R
Direct
2
s 1
i 1 ˆ
Vaˆr ln(OR ) i
where the Var[ln(ORi)] = 1/wi from the direct OR point estimate calculation.
2
s ai d i bi c i
2 i 1 ni
1 s
n1i n0i m1i m0i
i 1 n i 1n i
2
An example of the calculations for stratified data are provided next. Continuing
on with the example in table 15-3 on the association between sex and anemia in children,
7
the data are stratified on mothers education level. Again, because the data were based on
prevalent cases, the term “prevalent” will be used rather than “risk.”
Table 15-3. Example data; prevalence of anemia in children 12-23.9 months of age by
sex stratified on mothers education level.
Calculation of the directly adjusted prevalence ratio and its 95% confidence interval is
shown in Table 15-4.
Table 15-4. Calculations for computing directly adjusted prevalence (risk) ratio
Stratum PRi ln(PRi) wi wi ln(PRi)
1 1.326 .2821669 56.86628 16.04578
2 1.099 .0944001 162.75481 15.36407
Sum 219.62109 31.40985
31.40985
Pˆ RDirect exp 1.154
219.62109
1.96
1.154 exp 1.154 exp .132257
219.62109
(1.011, 1.317)
The interpretation would be that males were 1.154 times more likely to be anemic than
females controlling or adjusting for the mother’s education level. In addition, we are 95%
confident that the true prevalence ratio is captured between 1.011 and 1.317. However, we must
still calculate the test for interaction to see if the mother’s education level modifies the sex-
anemia relationship. To calculate the test for interaction, the directly adjusted risk ratio needs to
be calculated beforehand. Also, note that
8
1
vâr(ln Pˆ Ri )
wi
Therefore, the test for interaction for the prevalence/risk ratio would be:
s21
.2821669 .1432342 .0944001 .1432342
.017585 .0061442
2
s 1 1.097660 .388130 1.485790
The p-value for the chi square would be calculated for a chi square value of 1.486 with
one degree of freedom (the degrees of freedom is determined from the number of strata minus 1).
The p-value from this example is .223. Therefore, we would state that the mother’s education
level does not significantly modify the sex-anemia relationship. Therefore, the next question is
whether the mother’s education level confounds the relationship. The crude prevalence ratio was
1.16 and the directly adjusted value was 1.15, which is less than a 1% difference, therefore the
conclusion would be that mother’s education does not modify nor confound the sex-anemia
relationship.
The calculation of the directly adjusted Mantel-Haenszel prevalence ratio and its 95%
confidence interval is shown in Table 15-5.
Table 15-5. Calculations for computing the Mantel-Haenszel prevalence (risk) ratio
Stratum ain0i/ni bin1i/ ni (m1in1in0i-
aibini)/ni2
1 27.7037 20.8889 10.17650
2 58.8847 53.6023 19.3933
Sum 86.5884 74.4912 29.5698
86.5884
Pˆ RMH 1.162
74.4912
To calculate the 95% confidence interval we will first calculate the standard error of the
estimate:
29.5698
SE lnPˆ R MH 86.5884 * 74.4912
.067708
(1.018, 1.327)
Previously we found that mother’s education did not modify the sex-anemia relationship,
therefore the interpretation would be that, controlling for mother’s education, males were 1.162
9
times more likely to be anemic than females. However, because there is little confounding (the
crude value is 1.15), there is no need to control for mother’s education level.
Calculation of the directly adjusted prevalence difference and its 95% confidence interval is
shown in Table 15-6.
Table 15-6. Calculations for computing the direct adjusted prevalence (risk) difference
Stratum PDi wi wi PDi
1 0.1727 169.8171 29.3274
2 0.0623 378.6661 23.5909
Sum 548.4832 52.9183
52.9183
Pˆ DDirect .0965
548.4832
1.96
.0965 .0965 .0837
548.4832
(.0128, .1802)
Depending on the frequency of disease, it may be useful to describe the difference in term
of per 100 individuals (or percent), per 1,000, or some other unit. In this example, the males had
a prevalence of anemia 9.7% higher (in absolute terms) than females controlling for maternal
education, and we are 95% confident that the truth is captured between 1.3% and 18.1%.
However, before the decision is made as to whether or not to present the adjusted difference, the
test for interaction should be calculated. Again, note that:
1
vâr(ln Pˆ Di )
wi
Therefore, the test for interaction for prevalence/risk differences would be:
2
0.1727 .0965 0.0623 .0965
2
2
s 1
.00589 .00264
The chi square value of 1.42886 with one degree of freedom would have a p-value of
.232, which would not be statistically significant. The next step would be to determine whether
mother’s education confounds the sex-anemia relationship. The crude prevalence difference was
.097, the same as the adjusted difference, which would lead to the conclusion that there is no
important confounding in this analysis.
10
Calculation of the directly adjusted (prevalence) odds ratio and its 95% confidence interval
is shown in Table 15-7.
Table 15-7. Calculations for computing the direct adjusted (prevalence) odds ratio
Stratum ORi ln(ORi) wi wi ln(ORi)
1 2.095 .73955 9.09971 6.72969
2 1.323 .27990 18.91829 5.29523
Sum 28.01800 12.02492
12.02492
Oˆ RDirect exp 1.536
28.018
1.96
1.536 exp 1.536 exp .370286
28.018
(1.061, 2.224)
The interpretation would be that odds of anemia in males was 1.536 times the odds of
anemia in females controlling or adjusting for the mother’s education level. In addition, we are
95% confident that the true prevalence odds ratio is captured between 1.061 and 2.224. However,
we must still calculate the test for interaction to see if the mother’s education level modifies the
sex-anemia relationship. To calculate the test for interaction, the directly adjusted odds ratio
needs to be calculated beforehand. Also, note that
1
vâr(ln Oˆ Ri )
wi
Therefore, the test for interaction for the (prevalence) odds ratio would be:
s21
.73955 .429182 .27990 .429182
.10989 .05286
2
s 1 .87660 .42158 1.2918
The p-value for the chi square would be calculated for a chi square value of 1.2918 with
one degree of freedom (the degrees of freedom is determined from the number of strata minus 1).
The p-value from this example is .256. Therefore, we would state that the mother’s education
level does not significantly modify the sex-anemia relationship. Therefore, the next question is
whether the mother’s education level confounds the relationship. The crude prevalence odds ratio
was 1.536 and the directly adjusted value was the same, the conclusion would be that, based on
the odds ratio, mother’s education does not modify nor confound the sex-anemia relationship.
Calculation of the Mantel-Haenszel adjusted (prevalence) odds ratio and its 95%
confidence interval is as follows. The values that need to be calculated are shown in Table 15-8.
11
To calculate the point estimate and the confidence interval, eight values in Table 15-8 need to be
calculated.
34.66816
Oˆ RMH 1.536
22.57092
The standard error of the natural log of the point estimate is calculated as:
SE lnOˆ RMH
19.91786 12.85722 14.75040 9.71370
234.66816 2 x34.66816 x 22.57092 222.570922
2
The confidence interval based on the Robins, Greenland, Breslow method is:
(1.062, 2.222)
Previously we found that mother’s education did not modify the sex-anemia relationship,
therefore the interpretation would be that, controlling for mother’s education, the odds of males
having anemia were 1.536 times more likely to be anemic than the odds in females. However,
because there is little or no confounding (the crude value is 1.536), there is no need to control for
mother’s education level.
The overall Mantel-Haenszel uncorrected chi-square test would be calculated as with the
intermediate calculations shown in Table 15-9.
12
Table 15-9. Calculations for computing the Mantel-Haenszel uncorrected chi-square
test
Stratum (aidi-bici)/ni (n1in0im1i m0i)/[(ni-1)ni2]
1 6.81481 9.25832
2 5.28242 18.82774
Sum 12.09723 28.08606
Therefore
12
12.097232 5.2105
28.08606
13