You are on page 1of 13

Mathematical

Biostatistics
Bootcamp:
Lecture 10, T
Confidence
Intervals

Brian Caffo
Mathematical Biostatistics Bootcamp: Lecture 10, T
Table of
contents Confidence Intervals
Independent
group t
intervals

Likelihood Brian Caffo


method

Unequal Department of Biostatistics


variances
Johns Hopkins Bloomberg School of Public Health
Johns Hopkins University

April 24, 2013


Mathematical
Biostatistics
Bootcamp:
Lecture 10, T
Table of contents
Confidence
Intervals

Brian Caffo

Table of
contents 1 Table of contents
Independent
group t
intervals

Likelihood
2 Independent group t intervals
method

Unequal
variances
3 Likelihood method

4 Unequal variances
Mathematical
Biostatistics
Bootcamp:
Lecture 10, T
Independent group t confidence intervals
Confidence
Intervals

Brian Caffo

Table of
contents

Independent • Suppose that we want to compare the mean blood pressure between two
group t
intervals groups in a randomized trial; those who received the treatment to those who
Likelihood
method
received a placebo
Unequal • We cannot use the paired t test because the groups are independent and may
variances
have different sample sizes
• We now present methods for comparing independent groups
Mathematical
Biostatistics
Bootcamp:
Lecture 10, T
Notation
Confidence
Intervals

Brian Caffo

Table of • Let X1 , . . . , Xnx be iid N(µx , σ 2 )


contents

Independent
• Let Y1 , . . . , Yny be iid N(µy , σ 2 )
group t
intervals • Let X̄ , Ȳ , Sx , Sy be the means and standard deviations
Likelihood • Using the fact that linear combinations of normals are again normal, we know
method

Unequal
that Ȳ − X̄ is also normal with mean µy − µx and variance σ 2 ( n1x + 1
ny )
variances
• The pooled variance estimator

Sp2 = {(nx − 1)Sx2 + (ny − 1)Sy2 }/(nx + ny − 2)

is a good estimator of σ 2
Mathematical
Biostatistics
Bootcamp:
Lecture 10, T
Note
Confidence
Intervals

Brian Caffo • The pooled estimator is a mixture of the group variances, placing greater
Table of
weight on whichever has a larger sample size
contents
• If the sample sizes are the same the pooled variance estimate is the average of
Independent
group t the group variances
intervals

Likelihood
• The pooled estimator is unbiased
method

Unequal (nx − 1)E [Sx2 ] + (ny − 1)E [Sy2 ]


variances E [Sp2 ] =
nx + ny − 2
(nx − 1)σ 2 + (ny − 1)σ 2
=
nx + ny − 2

• The pooled variance estimate is independent of Ȳ − X̄ since Sx is independent


of X̄ and Sy is independent of Ȳ and the groups are independent
Mathematical
Biostatistics
Bootcamp:
Lecture 10, T
Result
Confidence
Intervals

Brian Caffo
• The sum of two independent Chi-squared random variables is Chi-squared with
Table of
contents degrees of freedom equal to the sum of the degrees of freedom of the
Independent summands
group t
intervals
• Therefore
Likelihood
method

Unequal
(nx + ny − 2)Sp2 /σ 2 = (nx − 1)Sx2 /σ 2 + (ny − 1)Sy2 /σ 2
variances

= χ2nx −1 + χ2ny −1

= χ2nx +ny −2
Mathematical
Biostatistics
Bootcamp:
Lecture 10, T
Putting this all together
Confidence
Intervals

Brian Caffo

Table of
• The statistic
contents Ȳ −X̄ −(µy −µx )
 1/2
Independent σ n1 + n1 Ȳ − X̄ − (µy − µx )
x y
group t
intervals
r =  1/2
(nx +ny −2)Sp2
Likelihood Sp n1x + n1y
method
(nx +ny −2)σ 2

Unequal
variances
is a standard normal divided by the square root of an independent Chi-squared
divided by its degrees of freedom
• Therefore this statistic follows Gosset’s t distribution with nx + ny − 2 degrees
of freedom
• Notice the form is (estimator - true value) / SE
Mathematical
Biostatistics
Bootcamp:
Lecture 10, T
Confidence interval
Confidence
Intervals

Brian Caffo

Table of
contents
• Therefore a (1 − α) × 100% confidence interval for µy − µx is
Independent
group t
intervals  1/2
1 1
Likelihood Ȳ − X̄ ± tnx +ny −2,1−α/2 Sp +
method nx ny
Unequal
variances
• Remember this interval is assuming a constant variance across the two groups
• If there is some doubt, assume a different variance per group, which we will
discuss later
Mathematical
Biostatistics
Bootcamp:
Lecture 10, T
Likelihood method
Confidence
Intervals

Brian Caffo

Table of
contents
• Exactly as before,
Independent
group t
Ȳ − X̄
intervals  1/2
1 1
Likelihood Sp nx + ny
method

Unequal µy −µx
variances
follows a non-central t distribution with non-centrality parameter  1/2
1
σ + n1
nx y

• Therefore, we can use this statistic to create a likelihood for (µy − µx )/σ, a
standardized measure of the change in group means
Mathematical
Biostatistics
Bootcamp:
Lecture 10, T
Example
Confidence
Intervals Example from Rosner Fundamentals of Biostatistics, Page 304
Brian Caffo
• Comparing SBP for 8 oral contraceptive users versus 21 controls
Table of
contents • X̄OC = 132.86 mmHg with sOC = 15.34 mmHg
Independent • X̄C = 127.44 mmHg with sC = 18.23 mmHg
group t
intervals
• Pooled variance estimate
Likelihood
method
7(15.34)2 + 20(18.23)2
Unequal sp2 = = 307.8
variances 8 + 21 − 2
• t27,.975 = 2.052 (in R, qt(.975, df = 27))
• Interval
(  1/2 )
1 1
132.86 − 127.44 ± 2.052 307.8 + = [−9.52, 20.36]
8 21
Mathematical
Biostatistics
Bootcamp:
Lecture 10, T
Likelihood plot for the effect size
Confidence
Intervals Reasonable values for the effect size from the confidence interval
Brian Caffo

Table of
[−9.52, 20.36]/sp = [−.54, 1.16]
contents

Independent
group t

1.0
intervals

Likelihood
method

0.8
Unequal
variances

0.6
Likelihood

0.4
0.2
0.0

−1.5 −1.0 −0.5 0.0 0.5 1.0 1.5

Effect Size
Mathematical
Biostatistics
Bootcamp:
Lecture 10, T
Unequal variances
Confidence
Intervals

Brian Caffo
• Note that under unequal variances
!
Table of
σ 2 σy2
contents
Ȳ − X̄ ∼ N µy − µ x , x +
Independent nx ny
group t
intervals

Likelihood • The statistic


method Ȳ − X̄ − (µy − µx )
Unequal
σy2 1/2
 2 
variances σx
nx + ny

approximately follows Gosset’s t distribution with degrees of freedom equal to


2
Sx2 /nx + Sy2 /ny
 2 2  2 2
Sx Sy
nx /(n x − 1) + ny /(ny − 1)
Mathematical
Biostatistics
Bootcamp:
Lecture 10, T
Example
Confidence
Intervals

Brian Caffo

Table of
contents • Comparing SBP for 8 oral contraceptive users versus 21 controls
Independent
group t
• X̄OC = 132.86 mmHg with sOC = 15.34 mmHg
intervals
• X̄C = 127.44 mmHg with sC = 18.23 mmHg
Likelihood
method • df = 15.04, t15.04,.975 = 2.13
Unequal
variances • Interval
1/2
15.342 18.232

132.86 − 127.44 ± 2.13 + = [−8.91, 19.75]
8 21

You might also like