Вы находитесь на странице: 1из 35

Biostatistics

Lecture 9
Lecture 8 Review
Proportions and confidence intervals
Calculation and interpretation of:
sample proportion
95% confidence interval for population
proportion
Calculation and interpretation of:


difference in sample proportions
95% confidence interval for difference
proportions
in population
Single proportion Inference


Estimated proportion of vivax malaria (p) = 15/100 = 0.15
Standard error of p
p(1 p) 0.15(1 0.15)
s e ( p ) . . = = = 0.036
n 100
95% Confidence interval for (population proportion)


Lower limit = p - 1.96s.e.
(p)
= 0.079

Upper limit = p + 1.96s.e.
(p)
= 0.221
Interpretation..
We are 95% confident, the population proportion () of people with vivax
malaria is between 0.079 and 0.221
(or between 7.9% and 22.1%)
Comparing two proportions
22 table



Proportion
Proportion
Proportion
of all subjects experiencing outcome, p = d/n
in exposed group, p
1
= d
1
/n
1

in unexposed group, p
0
= d
0
/n
0

With outcome
(diseased)
Without outcome
(disease-free)
Total
Exposed
(group 1)
d
1
h
1
n
1

Unexposed
(group 0)
d
0
h
0
n
0

Total d h n
Comparing two proportions
Example TBM trial
Death during 9 months post start
of treatment
Treatment group Yes No Total
Dexamethasone
(group 1)
87
(p
1
=0.318)
187 274
Placebo
(group 0)
112
(p
0
=0.413)
159 271
Total 199 346 545
Comparing two proportions - Inference
Example:- TBM trial
Estimate of difference in population proportions
= p
1
-p
0
= -0.095
s.e.
(p1-p0)

= 0.041
95% CI for difference in population proportions (
1
-
0
):

-0.095 1.960.041
-0.175 up to -0.015 OR -17.5% up to -1.5%
Interpretation:-
We are 95% confident, that the difference in population proportions is
between -17.5% (dexamethasone reduces the proportion of deaths by a
large amount) and -1.5% (dexamethasone marginally reduces the
proportion of deaths).
Comparing two proportions (absolute difference):-
Risk difference
Example:- TBM trial
Outcome measure: Death during nine months
treatment.
following start of
Dexamethasone
p
1
(incidence risk)

= d
1
/n
1
= 87/274 = 0.318

Placebo
p
0
(incidence risk)
= d
0
/n
0
= 112/271 = 0.413

p
1
p
0
(risk difference) = 0.318 0.413 = -0.095 (or

-9.5%)
Lecture 9 Measures of association
22 table (RECAP)
Measures of association


Risk difference
Risk ratio
Odds ratio
Calculation & interpretation of confidence interval for
each measure of association
22 table



Proportion
Proportion
Proportion
of all subjects experiencing outcome, p = d/n
in exposed group, p
1
= d
1
/n
1

in unexposed group, p
0
= d
0
/n
0

With outcome
(diseased)
Without outcome
(disease-free)
Total
Exposed
(group 1)
d
1
h
1
n
1

Unexposed
(group 0)
d
0
h
0
n
0

Total d h n
22 table - Measures of association
Different
between
measures of association
outcome and exposure
Can calculate confidence intervals and test statistics for
each measure
Measure of Effect Formula
Risk difference
(lecture 8)
p
1
-p
0

Risk ratio (relative risk)
p
1
/ p
0

Odds ratio
(d
1
/h
1
) / (d
0
/h
0
)
22 table TBM trial example
Death during 9
months post start
of treatment
Treatment group Yes No Total Incidence risk
of death (p)
Odds of death
Dexamethasone
(group 1)
87
(d
1
)
187
(h
1
)
274
(n
1
)
d
1
/ n
1

= 0.318
d
1
/ h
1

= 0.465
Placebo
(group 0)
112
(d
0
)
159
(h
0
)
271
(n
0
)
d
0
/ n
0

= 0.413
d
0
/ h
0

= 0.704
Total 199 346 545
22 table TBM trial example
Risk difference = p
1
-p
0

= 0.318 0.413 = -0.095 (or -9.5%)
Risk ratio = p
1
/p
0
= 0.318 / 0.413 = 0.77

Odds ratio = (d
1
/h
1
) / (d
0
/h
0
) = 0.465 / 0.704 = 0.66

Death during 9 months post start
of treatment
Treatment group Yes No Total
Dexamethasone
(group 1)
87 (d
1
) 187 (h
1
) 274 (n
1
)
Placebo
(group 0)
112 (d
0
) 159 (h
0
) 271 (n
0
)
Total 199 346 545
22 table Calculation of Odds Ratio
Commonly given formula for odds ratio
(ad) / (bc) = (87159) / (187112) = 0.66
Death during 9 months post start
of treatment
Treatment group Yes No Total
Dexamethasone
(group 1)
87 (a) 187 (b) 274 (n
1
)
Placebo
(group 0)
112 (c) 159 (d) 271 (n
0
)
Total 199 346 545
22 table Calculation of Odds Ratio
Odds ratio for not dying
= (ad) / (bc) = (187112) /
(=1/0.66)
(87159) = 1.51
Death during 9 months post start
of treatment
Treatment group No Yes Total
Dexamethasone
(group 1)
187 (a) 87 (b) 274 (n
1
)
Placebo
(group 0)
159 (c) 112 (d) 271 (n
0
)
Total 346 199 545
Differences in measures of association
When there is no association between exposure and outcome,
risk difference = 0
risk ratio (RR) = 1
odds ratio (OR) = 1
Risk difference can be negative or positive
RR & OR are always positive
For rare outcomes, OR ~ RR
OR is always further from 1 than corresponding RR
If RR > 1 then OR > RR
If RR < 1 the OR < RR
Interpretation of measures of association
RR & OR < 1, associated with a reduced risk / odds (may be
protective)
RR = 0.8 (reduced risk of 20%)
RR & OR > 1, associated with an increased risk / odds
RR = 1.2 (increased risk of 20%)
RR & OR further the risk is from 1, stronger the association
between exposure and outcome (e.g. RR=2 versus RR=3).
Inference
Obtain a sample estimate, q, of the population parameter (e.g.
difference in proportions)
REMEMBER different samples would give different estimates
of the population parameter (e.g. sample 1 q
1
, sample 2 q
2
,)
Derive:
Standard error of q (i.e. s.e
.(q)
)
Confidence interval (i.e. q (1.96 s.e.
(q)
)
Ratios Risk ratio (RR) or Odds ratio (OR)
Usual confidence intervals formula,
q (1.96s.e
.(q)
), is problematic for ratios.
When q is close to zero and s.e
.(q)

large,
calculated lower limit of confidence interval may be
negative
Risk ratio (RR)
Solution Calculate the logarithm of
(log
e
RR) and its standard error

RR
1

1 1

1

s.e. (lo g
e
RR ) =

+
d
1
n
1
d
0
n
0

95% CI for logarithm of RR :-
Upper limit
Lower limit
= log
e
RR

= log
e
RR

+ 1.96s.e.
(logeRR)

- 1.96s.e.
(logeRR)

95% CI for Risk ratio (RR):-
Upper limit = antilog (upper limit of CI for log
e
RR)

Lower limit = antilog (lower limit of CI for log
e
RR)

Log to the base e & antilog
e
(exponential)

Natural logarithms use the mathematical constant, e, as
their base, e=2.71828
1618 Scottish
Mathematician: John Napier
e
x
antilog
e
x = exp(x) =

e = 2.718
log
e
2.718 = 1 antilog
e
1 = 2.718
e
2
= 7.388
log
e
7.388 = 2 antilog
e
2 = 7.388
e
3
= 20.079
log
e
20.079 = 3 antilog
e
3 = 20.079
10
1
= 10
log
10
10 = 1 antilog
10
1 = 10
10
2
= 100
log
10
100 = 2 antilog
10
2 = 100
10
3
= 1000
log
10
1000 = 3 antilog
10
3 = 1000
22 table TBM trial example
Risk ratio = p
1
/p
0
= 0.318 / 0.413 =

log
e
RR = log
e
(0.77) = -0.26
0.77
1

1
+
1

1

s.e.(lo g RR ) =

e
= 0.11
87 274 112 271
95% CI for log
e
RR: -0.48 up to -0.04

95% CI for RR: exp(-0.48) up to exp(-0.04) = 0.62 up
to 0.96
Death during 9 months post start
of treatment
Treatment group Yes No Total
Dexamethasone
(group 1)
87 (d
1
) 187 (h
1
) 274 (n
1
)
Placebo
(group 0)
112 (d
0
) 159 (h
0
) 271 (n
0
)
Total 199 346 545
Using Stata

csi 87 112 187 159
| Exposed Unexposed | Total
-----------------+------------------------+------------
Cases |
Noncases |
87
187
112
159
|
|
199
346
-----------------+------------------------+------------
Total |
|
|
|
|
274 271 |
|
|
|
|
545
Risk .3175182 .4132841 .3651376
Point estimate [95% Conf. Interval]
|------------------------+------------------------
Risk difference
Risk ratio
Prev. frac. ex.
Prev. frac. pop
|
|
|
|
-.0957659
.7682808
.2317192
.1164974
|
|
|
|
-.1762352 -.0152966
.6139856 .9613505
.0386495 .3860144
+-------------------------------------------------
chi2(1) = 5.39 Pr>chi2 = 0.0202
Remember the warning about how the table is presented
-Stata requires presentation with outcome by rows and exposure by
columns
Results are close to those obtained by hand
22 table TBM trial example
Interpretation..
Dexamethasone was associated with an estimated decreased
risk of 23% (estimated RR=0.77) for death during 9 months post
start of treatment.
We are 95% confident, that the population risk ratio, lies between
0.62 (decreased risk of 38%) and 0.96 (decreased risk of 4%).
Death during 9 months post start
of treatment
Treatment group Yes No Total
Dexamethasone
(group 1)
87 (d
1
) 187 (h
1
) 274 (n
1
)
Placebo
(group 0)
112 (d
0
) 159 (h
0
) 271 (n
0
)
Total 199 346 545
95% confidence interval for Odds ratio (OR)
Calculate the logarithm of OR (log
e
OR) and its standard

error.
1 1 1 1 Woolfs formula
s.e.(lo g OR ) =

e
+ + +
d
1

h
1

d
0

h
0

95% CI for logarithm of OR :-
Upper limit = log
e
OR + 1.96s.e.
(logeOR)

Lower limit = log
e
OR - 1.96s.e.
(logeOR)

95% CI for Odds ratio (OR):-
Upper limit = exp (upper limit of CI for log
e
OR)

Lower limit = exp (lower limit of CI for log
e
OR)

22 table TBM trial example
Odds Ratio = (d
1
/h
1
)/ (d
0
/h
0
) = 0.66

log
e
OR = log
e
(0.66) = -0.42
1
+
1
+
1
+
1


s.e.(lo g OR ) =

e
= 0.18
87 187 112 159
95% CI for log
e
OR: -0.77 up to -0.07

95% CI for OR: exp(-0.77) up to exp(-0.07) = 0.46 up
to 0.93
Death during 9 months post start
of treatment
Treatment group Yes No Total
Dexamethasone
(group 1)
87 (d
1
) 187 (h
1
) 274 (n
1
)
Placebo
(group 0)
112 (d
0
) 159 (h
0
) 271 (n
0
)
Total 199 346 545
Using Stata

. csi 87 112 187 159, or
| Exposed Unexposed | Total
-----------------+------------------------+------------
Cases |
Noncases |
87
187
112
159
|
|
199
346
-----------------+------------------------+------------
Total |
|
|
274 271 |
|
|
545
Risk .3175182 .4132841 .3651376
|
|
|
| Point estimate [95% Conf. Interval]
|------------------------+------------------------
Risk difference
Risk ratio
Prev. frac. ex.
Prev. frac. pop
Odds ratio
|
|
|
|
|
-.0957659
.7682808
.2317192
.1164974
.6604756
|
|
|
|
|
-.1762352
.6139856
.0386495
-.0152966
.9613505
.3860144
.4652544 .937623 (Cornfield)
+-------------------------------------------------
chi2(1) = 5.39 Pr>chi2 = 0.0202
For OR, by default Stata uses Cornfields formula for se. You can request
the Woolf formula as csi 87 112 187 159, or woolf
Test statistic for
Risk ratio (RR) & Odds ratio (OR)
Null hypothesis:-
population RR = 1 or population OR = 1
For risk ratio:-
log
e
RR log e1
0.26 0
z = = = 2.4
s.e.(lo g RR ) 0.11
e
2-sided p-value = 0.016
Test statistic for
Risk ratio (RR) & Odds
Null hypothesis:-
ratio (OR)
population RR = 1 or population OR = 1
For odds ratio:-
log
e
OR log e1

0.42
0
z = = = 2.3
s.e.(lo g OR ) 0.18
e
2-sided p-value = 0.021
Comparing the outcome measure of two exposure groups
(groups 1 & 0)
1 0 1 0 1 0
s.e.( p ) + s.e.( p )

1 0
p
=
Outcome
variable
data type
Population
parameter
Estimate of
population
parameter
from sample
Standard error 95% Confidence
interval for population
parameter
Numerical

0


x1 x0

s.e.( x 1 x 0 )
2 2

= s.e.( x 1 ) + s.e.( x 0 )

x1 x0
1.96 s.e.( x 1 x 0 )

Categorical

0


p p

s.e.( p p )
2 2

p p
1.96 s.e.(
1
p
0
)
Comparing the outcome measure of two exposure groups
(groups 1 & 0)
s.e.(lo g RR ) =
e
+
1 1 0 0
Outcome
variable
data type
Population
parameter
Estimate
of
population
parameter
from
sample
Standard error of
log
e
(parameter)
95% Confidence interval of
log
e
(population parameter)
Categorical

Population
risk ratio

p
1
/p
0


1 1 1 1
d
1
n
1
d
0
n
0


log eRR
1.96 s.e.(log eRR )

Categorical

Population
odds ratio

(d
1
/h
1
) /
(d
0
/h
0
)

1 1 1 1

s.e.(lo g
e
OR) =
d
+
h
+
d
+
h

logeOR
1.96 s.e.(log eOR)
Calculation of p-values for comparing two groups
z =
s.e.( p p )
z =
e
s.e.(log ( OR ))
Outcome
variable
data type
Population parameter Population parameter
under null hypothesis
Test statistic
Numerical

0
=0

x1 x0
s.e.( x 1 x 0 )

Categorical

1
-
0

Population risk ratio
Population odds ratio

1
-
0
=0
Population risk ratio=1
Population odds ratio=1
z =
p
1
p
0

1 0
log
e
( RR)
s.e.(log ( RR ))
z =
log
e
(OR)
e
Comparing the outcome measure of two exposure groups
(TBM trial: dexamethasone versus placebo)
Outcome
variable
data type
Population
parameter
under null
hypothesis
Estimate of
population
parameter
from sample
95% confidence
interval for
population
parameter
Two-sided p-value
Categorical Population
risk
difference
= 0

p
1
-p
0

= -0.095

-0.175, -0.015

0.020
Categorical

Population
risk ratio
= 1

p
1
/p
0

= 0.77

0.62, 0.96

0.016

Categorical

Population
odds ratio
= 1

(d
1
/h
1
) / (d
0
/h
0
)
= 0.66

0.46, 0.93

0.021
Using Stata
p-value calculated using Chi-squared test

. csi 87 112 187 159, or
| Exposed Unexposed | Total
-----------------+------------------------+------------
Cases |
Noncases |
87
187
112
159
|
|
199
346
-----------------+------------------------+------------
Total |
|
|
274 271 |
|
|
545
Risk .3175182 .4132841 .3651376
|
|
|
| Point estimate [95% Conf. Interval]
|------------------------+------------------------
Risk difference
Risk ratio
Prev. frac. ex.
Prev. frac. pop
Odds ratio
|
|
|
|
|
-.0957659
.7682808
.2317192
.1164974
.6604756
|
|
|
|
|
-.1762352
.6139856
.0386495
-.0152966
.9613505
.3860144
.4652544 .937623 (Cornfield)
+-------------------------------------------------
chi2(1) = 5.39 Pr>chi2 = 0.0202
For OR, by default Stata uses Cornfields formula for se. You can request
the Woolf formula as csi 87 112 187 159, or woolf
Lecture 9 - Objectives
Calculate and interpret the measures of
association and their
and test statistics
confidence intervals



Risk difference
Risk ratio
Odds ratio
Thank You
www.HelpWithAssignment.com

Вам также может понравиться