You are on page 1of 2

Title:

Computation of Power for 1 Proportion and 2 Proportions

Introduction
This document outlines the computation of power for 1 proportion and for 2 proportions.
If we are given the power and are solving for the sample size or for the value of p, we use an iterative
algorithm. At each iteration, we must evaluate the power for a trial sample size or value of p. So this outline
applies to those calculations as well.
For the one-sided alternatives, an iterative solution is not actually necessary, since given a function to
calculate the inverse of we can solve for n directly. However, for the two-sided alternative, an
iterative solution is required.
1 Proportion
p0
p1
n
z

= hypothesized p
= alternative p
= sample size
= (p-hat p0) / sqrt( p0 (1 p0) / n )

Suppose the alternative is one-sided, p > p0. Then


Power = Pr{ z > z }
= Pr{ (p-hat p0) / sqrt( p0 (1 p0) / n ) > z }
= Pr{ p-hat > p0 + z sqrt( p0 (1 p0) / n ) }
= Pr{ (p-hat p1) / sqrt( p1 (1 p1) / n ) > [p0 p1 + z sqrt( p0 (1 p0) / n )] / sqrt( p1 (1 p1) / n ) }
1 ( [p0 p1 + z sqrt( p0 (1 p0) / n )] / sqrt( p1 (1 p1) / n ) )
where all probabilities are computed under the alternative p = p1 and is the standard normal cumulative
distribution function.
Suppose the alternative is one-sided, p < p0. Then
Power = Pr{ z < z }
( [p0 p1 z sqrt( p0 (1 p0) / n )] / sqrt( p1 (1 p1) / n ) )
Suppose the alternative is two-sided, p p0. Then
Power

= Pr{ z > z/2 } + Pr{ z < z/2 }


1 ( [p0 p1 + z/2 sqrt( p0 (1 p0) / n )] / sqrt( p1 (1 p1) / n ) )
+ ( [p0 p1 z/2 sqrt( p0 (1 p0) / n )] / sqrt( p1 (1 p1) / n ) )

2 Proportions
p1
p2
pc
n
z

= p for first population


= p for second population
= ( p1 + p2 ) / 2
= sample size (for each sample)
= (p1-hat p2-hat) / sqrt( 2 pc (1 pc) / n )

Suppose the alternative is one-sided, p1 > p2. Then


Power = Pr{ z > z }
= Pr{ (p1-hat p2-hat) / sqrt( 2 pc (1 pc) / n ) > z }
= Pr{ (p1-hat p2-hat) > z sqrt( 2 pc (1 pc) / n ) }
= Pr{ [(p1-hat p2-hat) ( p1 p2)] / sqrt( p1 (1 p1) / n + p2 (1 p2) / n ) >
[ ( p1 p2) + z sqrt( 2 pc (1 pc) / n )] / sqrt( p1 (1 p1) / n + p2 (1 p2) / n ) }
1 ( [ ( p1 p2) + z sqrt( 2 pc (1 pc) / n )] / sqrt( p1 (1 p1) / n + p2 (1 p2) / n ) )
Suppose the alternative is one-sided, p1 < p2. Then
Power = Pr{ z < -z }
( [ ( p1 p2) z sqrt( 2 pc (1 pc) / n )] / sqrt( p1 (1 p1) / n + p2 (1 p2) / n ) )
Suppose the alternative is two-sided, p1 p2. Then
Power

= Pr{ z > z/2 } + Pr{ z < z/2 }


1 ( [ ( p1 p2) + z/2 sqrt( 2 pc (1 pc) / n )] / sqrt( p1 (1 p1) / n + p2 (1 p2) / n ) )
+ ( [ ( p1 p2) z/2 sqrt( 2 pc (1 pc) / n )] / sqrt( p1 (1 p1) / n + p2 (1 p2) / n ) )

Note.
Instead of the z defined above, we could have used
z* = (p1-hat p2-hat) / sqrt( p1 (1 p1) / n + p2 (1 p2) / n ).
Note that
p1 (1 p1) / n + p2 (1 p2) / n 2 pc (1 pc) / n
so that
| z*| |z|
This means that power values for z* are at least as large as those computed for z.

You might also like