Tests For Two Proportions
Tests For Two Proportions
com
Chapter 200
Technical Details
Suppose you have two populations from which dichotomous (binary) responses will be recorded. The probability
(or risk) of obtaining the event of interest in population 1 (the treatment group) is p1 and in population 2 (the
control group) is p2 . The corresponding failure proportions are given by q1 = 1 − p1 and q2 = 1 − p2 .
The assumption is made that the responses from each group follow a binomial distribution. This means that the
event probability, pi , is the same for all subjects within the group and that the response from one subject is
independent of that of any other subject.
Random samples of m and n individuals are obtained from these two populations. The data from these samples
can be displayed in a 2-by-2 contingency table as follows
200-1
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
The binomial proportions p1 and p2 are estimated from these data using the formulae
a x11 b x
p1 = = and p 2 = = 21
m n1 n n2
Parameter Computation
Difference δ = p1 − p2
Risk Ratio φ = p1 / p2
p1 / (1 − p1 ) p1q2
Odds Ratio ψ= =
p2 / (1 − p2 ) p2q1
The tests analyzed by this routine are for the null case. This refers to the values of the above parameters under the
null hypothesis. In the null case, the difference is zero and the ratios are one under the null hypothesis. In the non-
null case, discussed in another chapter, the difference is some value other than zero and the ratios are some value
other than one. The non-null case often appears in equivalence and non-inferiority testing.
200-2
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
Hypothesis Tests
Several statistical tests have been developed for testing the inequality of two proportions. For large samples, the
powers of the various tests are about the same. However, for small samples, the differences in the powers can be
quite large. Hence, it is important to base the power analysis on the test statistic that will be used to analyze the
data. If you have not selected a test statistic, you may wish to determine which one offers the best power in your
situation. No single test is the champion in every situation, so you must compare the powers of the various tests to
determine which to use.
Difference
The (risk) difference, δ = p1 − p2 , is perhaps the most direct measure for comparing two proportions. Three sets
of statistical hypotheses can be formulated:
1. H 0 : p1 − p2 = 0 versus H1: p1 − p2 ≠ 0 ; this is often called the two-tailed test.
2. H 0 : p1 − p2 ≤ 0 versus H1: p1 − p2 > 0 ; this is often called the upper-tailed test.
3. H 0 : p1 − p2 ≥ 0 versus H1: p1 − p2 < 0 ; this is often called the lower-tailed test.
The traditional approach for testing these hypotheses has been to use the Pearson chi-square test for large
samples, the Yates chi-square for intermediate sample sizes, and the Fisher Exact test for small samples. Recently,
some authors have begun questioning this solution. For example, based on exact enumeration, Upton (1982) and
D’Agostino (1988) conclude that the Fisher Exact test and Yates test should never be used.
Ratio
The (risk) ratio, φ = p1 / p2 , is often preferred to the difference when the baseline proportion is small (less than
0.1) or large (greater than 0.9) because it expresses the difference as a percentage rather than an amount. In this
null case, the null hypothesized ratio of proportions, φ0 , is one. Three sets of statistical hypotheses can be
formulated:
1. H 0 : p1 / p2 = φ0 versus H1: p1 / p2 ≠ φ0 ; this is often called the two-tailed test.
2. H 0 : p1 / p2 ≤ φ0 versus H1: p1 / p2 > φ0 ; this is often called the upper-tailed test.
3. H 0 : p1 / p2 ≥ φ0 versus H1: p1 / p2 < φ0 ; this is often called the lower-tailed test.
Odds Ratio
o1 p / (1 − p1 ) p1q2
The odds ratio, ψ = = 1 = , is sometimes used to compare the two proportions because of its
o2 p2 / (1 − p2 ) p2q1
statistical properties and because some experimental designs require its use. In this null case, the null
hypothesized odds ratio, ψ 0 , is one. Three sets of statistical hypotheses can be formulated:
200-3
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
Power Calculation
The power for a test statistic that is based on the normal approximation can be computed exactly using two
binomial distributions. The following steps are taken to compute the power of such a test.
1. Find the critical value (or values in the case of a two-sided test) using the standard normal distribution. The
critical value, zcritical , is that value of z that leaves exactly the target value of alpha in the appropriate tail of
the normal distribution. For example, for an upper-tailed test with a target alpha of 0.05, the critical value is
1.645.
2. Compute the value of the test statistic, zt , for every combination of x11 and x21 . Note that x11 ranges from
0 to n1 , and x21 ranges from 0 to n2 . A small value (around 0.0001) can be added to the zero cell counts to
avoid numerical problems that occur when the cell value is zero.
3. If zt > z critical , the combination is in the rejection region. Call all combinations of x11 and x21 that lead to a
rejection the set A.
4. Compute the power for given values of 𝑝𝑝1 and 𝑝𝑝2 as
𝑛𝑛1 𝑥𝑥 𝑛𝑛 −𝑥𝑥 𝑛𝑛2 𝑥𝑥 𝑛𝑛 −𝑥𝑥
1 − 𝛽𝛽 = � �𝑥𝑥 � 𝑝𝑝1 11 𝑞𝑞1 1 11 �𝑥𝑥 � 𝑝𝑝2 21 𝑞𝑞2 2 21 .
11 21
𝐴𝐴
5. Compute the actual value of alpha achieved by the design by substituting 𝑝𝑝2 for 𝑝𝑝1 to obtain
𝑛𝑛1 𝑥𝑥 𝑛𝑛 −𝑥𝑥 𝑛𝑛2 𝑥𝑥 𝑛𝑛 −𝑥𝑥
𝛼𝛼 ∗ = � �𝑥𝑥 � 𝑝𝑝2 11 𝑞𝑞2 1 11 �𝑥𝑥 � 𝑝𝑝2 21 𝑞𝑞2 2 21
11 21
𝐴𝐴
𝑛𝑛1 𝑛𝑛2 𝑥𝑥 +𝑥𝑥 𝑛𝑛 +𝑛𝑛 −𝑥𝑥 −𝑥𝑥
= � �𝑥𝑥 � �𝑥𝑥 � 𝑝𝑝2 11 21 𝑞𝑞2 1 2 11 21 .
11 21
𝐴𝐴
When the values of n1 and n2 are large (say over 200), these formulas may take a little time to evaluate. In this
case, a large sample approximation may be used.
Test Statistics
The various test statistics that are available in this routine are listed next.
200-4
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
where
A( m) = {all pairs x1 , x 2 such that x1 + x 2 = m, given T ≥ t}
Pr(T ≥ tα | m, H 0 ) ≤ α
The power is defined as
N
1 − β = ∑ P( m) Pr(T ≥ tα | m, H1 )
m= 0
where
b( x1 , n1 , p1 )b( x 2 , n2 , p2 )
Pr(T ≥ tα | m, H1 ) = ∑
A( m,T ≥ tα ) ∑ b( x1 , n1 , p1 )b( x 2 , n2 , p2 )
A m
( )
P( m) = Pr( x1 + x 2 = m| H1 )
= b( x1 , n1 , p1 )b( x 2 , n2 , p2 )
n
b( x , n, p) = p x (1 − p)
n− x
x
When the normal approximation is used to compute power, the result is based on the pooled, continuity corrected
Z test.
200-5
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
Unpooled Version
p 1 (1 − p 1 ) p 2 (1 − p 2 )
σ D = +
n1 n2
Power
The power of this test is computed using the enumeration procedure described above. For large sample sizes, the
following approximation is used as presented in Chow et al. (2008).
1. Find the critical value (or values in the case of a two-sided test) using the standard normal distribution.
The critical value is that value of z that leaves exactly the target value of alpha in the tail.
2. Use the normal approximation to binomial distribution to compute binomial probabilities, compute the
power for the pooled and unpooled tests, respectively, using
zα σ D , p + ( p1 − p2 ) zα σ D ,u + ( p1 − p2 )
Pooled: 1 − β = Pr Z < Unpooled: 1 − β = Pr Z <
σ D ,u σ D ,u
where
p1q1 p2 q2
σ D ,u = + (unpooled standard error)
n1 n2
1 1
σ D , p = pq + (pooled standard error)
n1 n2
n1 p1 + n2 p2
with p = and q = 1 − p
n1 + n2
Z Test (or Chi-Square Test) with Continuity Correction (Pooled and Unpooled)
Frank Yates is credited with proposing a correction to the Pearson Chi-Square test for the lack of continuity in the
binomial distribution. However, the correction was in common use when he proposed it in 1922. Although this
test is often expressed directly as a Chi-Square statistic, it is expressed here as a z statistic so that it can be more
easily used for one-sided hypothesis testing.
Both pooled and unpooled versions of this test have been discussed in the statistical literature. The pooling refers
to the way in which the standard error is estimated. In the pooled version, the two proportions are averaged, and
only one proportion is used to estimate the standard error. In the unpooled version, the two proportions are used
separately.
The continuity corrected z-test is
F1 1
( p1 − p 2 ) + +
2 n1 n2
z=
σ D
where F is -1 for lower-tailed, 1 for upper-tailed, and both -1 and 1 for two-sided hypotheses.
200-6
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
Pooled Version
1 1
σ D = p (1 − p ) +
n1 n2
n1 p1 + n2 p 2
p =
n1 + n2
Unpooled Version
p 1 (1 − p 1 ) p 2 (1 − p 2 )
σ D = +
n1 n2
Power
The power of this test is computed using the enumeration procedure described for the z-test above. For large
samples, approximate results based on the normal approximation to the binomial are used.
Power
The power of this test is computed using the enumeration procedure described above.
Power
The power of this test is computed using the enumeration procedure described above. When large sample results
are needed, the results for the z test are used.
200-7
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
T-Test
Based on a study of the behavior of several tests, D’Agostino (1988) and Upton (1982) proposed using the usual
two-sample t-test for testing whether two proportions are equal. One substitutes a “1” for a success and a “0” for a
failure in the usual, two-sample t-test formula. The test statistic is computed as
1
N −2 2
tN − 2 = (ad − bc)
N ( nac + mbd )
which can be compared to the t distribution with N-2 degrees of freedom.
Power
The power of this test is computed using the enumeration procedure described above, except that the t tables are
used instead of the standard normal tables.
Procedure Options
This section describes the options that are specific to this procedure. These are located on the Design tab. For
more information about the options of other tabs, go to the Procedure Window chapter.
Design Tab
The Design tab contains the parameters associated with this test such as the proportions, sample sizes, alpha, and
power.
Solve For
Solve For
This option specifies the parameter to be solved for using the other parameters. The parameters that may be
selected are Power, Sample Size, and Effect Size. Under most situations, you will select either Power or Sample
Size.
Select Power when you want to calculate the power of an experiment.
Select Sample Size when you want to calculate the sample size needed to achieve a given power and alpha level.
Power Calculation
Power Calculation Method
Select the method to be used to calculate power. When the sample sizes are reasonably large (i.e. greater than 50)
and the proportions are between 0.2 and 0.8 the two methods will give similar results. For smaller sample sizes
and more extreme proportions (less than 0.2 or greater than 0.8), the normal approximation is not as accurate so
the binomial calculations may be more appropriate.
The choices are
• Binomial Enumeration
Power for each test is computed using binomial enumeration of all possible outcomes when N1 and N2 ≤
Maximum N1 or N2 for Binomial Enumeration (otherwise, the normal approximation is used). Binomial
enumeration of all outcomes is possible because of the discrete nature of the data.
200-8
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
• Normal Approximation
Approximate power for each test is computed using the normal approximation to the binomial distribution.
Actual alpha values are only computed when “Binomial Enumeration” is selected.
When either N1 or N2 is larger than this amount, the normal approximation to the binomial is used for power
calculations.
Zero Count Adjustment Method
Zero cell counts cause many calculation problems when enumerating binomial probabilities. To compensate for
this, a small value (called the “Zero Count Adjustment Value”) may be added either to all cells or to all cells with
zero counts. This option specifies which type of adjustment you want to use.
Adding a small value is controversial, but may be necessary. Some statisticians recommend adding 0.5 while
others recommend 0.25. We have found that adding values as small as 0.0001 seems to work well.
Zero Count Adjustment Value
Zero cell counts cause many calculation problems when enumerating binomial probabilities. To compensate for
this, a small value may be added either to all cells or to all zero cells. This is the amount that is added. We have
found that 0.0001 works well.
Be warned that the value of the ratio and the odds ratio will be affected by the amount specified here!
Test
Alternative Hypothesis
Specify whether the alternative hypothesis of the test is one-sided or two-sided. If a one-sided test is chosen, the
hypothesis test direction is chosen based on whether P1 is greater than or less than P2.
200-9
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
200-10
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
200-11
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
200-12
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
Percent in Group 1
This option is displayed only if Group Allocation = “Enter total sample size and percentage in Group 1.”
This value fixes the percentage of the total sample size allocated to Group 1. Small variations from the specified
percentage may occur due to the discrete nature of sample sizes.
The Percent in Group 1 must be greater than 0 and less than 100. You can enter a single value or a series of
values.
Effect Size
Input Type
Indicate what type of values to enter to specify the effect size. Regardless of the entry type chosen, the test
statistics used in the power and sample size calculations are the same. This option is simply given for convenience
in specifying the effect size.
P1 (Group 1 Proportion |H1)
Enter a value for the proportion in group 1 (the experimental or treatment group) under the alternative hypothesis,
H1. The power calculations assume that this is the actual value of the proportion.
You may enter a range of values such as 0.1 0.2 0.3 or 0.1 to 0.9 by 0.1.
Note that values must be between zero and one and cannot be equal to P2.
D1 (Difference|H1 = P1-P2)
This option specifies the difference between the two proportions under the alternative hypothesis, H1. This
difference is used with P2 to calculate the value of P1 using the formula: P1 = D1 + P2. Differences must be
between -1 and 1. They cannot take on the values -1, 0, or 1.
The power calculations assume that P1 is the actual value of the proportion in group 1 (the experimental or
treatment group).
You may enter a range of values such as 0.03 0.05 0.10 or 0.01 to 0.05 by 0.01.
R1 (Ratio|H1 = P1/P2)
This option specifies the ratio between the two proportions, P1 and P2. This ratio is used with P2 to calculate the
value of P1 at which the power is calculated using the formula: P1=(R1) x (P2). The power calculations assume
that P1 is the actual value of the proportion in group 1, which is the experimental, or treatment, group.
You may enter a range of values such as 0.5 0.6 0.7 0.8 or 1.25 to 2.0 by 0.25. Ratios must greater than zero. They
cannot take on the value of one.
OR1 (Odds Ratio|H1 = O1/O2)
This option specifies the odds ratio of the two proportions, P1 and P2. This odds ratio is used with P2 to calculate
the value of P1. The power calculations assume that P1 is the actual value of the proportion in group 1, which is
the experimental, or treatment, group.
You may enter a range of values such as 0.5 0.6 0.7 0.8 or 1.25 to 2.0 by 0.25. Odds ratios must greater than zero.
They cannot take on the value of one.
P2 (Group 2 Proportion)
Enter a value for the proportion in group 2 (the control, baseline, standard, or reference group). The null
hypothesis is that the two proportions, P1 and P2, are both equal to this value.
Since these values are proportions, values must be between zero and one.
You may enter a range of values such as 0.1,0.2,0.3 or 0.1 to 0.9 by 0.1.
200-13
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
Setup
This section presents the values of each of the parameters needed to run this example. First, from the PASS Home
window, load the Tests for Two Proportions procedure window by expanding Proportions, then Two
Independent Proportions, then clicking on Test (Inequality), and then clicking on Tests for Two Proportions.
You may then make the appropriate entries as listed below, or open Example 1 by going to the File menu and
choosing Open Example Template.
Option Value
Design Tab
Solve For ................................................ Power
Power Calculation Method ...................... Normal Approximation
Alternative Hypothesis ............................ Two-Sided
Test Type ................................................ Z-Test (Pooled)
Alpha ....................................................... 0.05
Group Allocation ..................................... Equal (N1 = N2)
Sample Size Per Group .......................... 50 to 650 by 100
Input Type ............................................... Differences
D1 (Difference|H1 = P1–P2) ................... 0.05 0.10
P2 (Group 2 Proportion) ......................... 0.6
Output
Click the Calculate button to perform the calculations and generate the following output.
Numeric Results
Numeric Results for Testing Two Proportions using the Z-Test with Pooled Variance
H0: P1 - P2 = 0. H1: P1 - P2 = D1 ≠ 0.
Diff
Power* N1 N2 N P1 P2 D1 Alpha
0.08073 50 50 100 0.6500 0.6000 0.0500 0.0500
0.14513 150 150 300 0.6500 0.6000 0.0500 0.0500
0.21093 250 250 500 0.6500 0.6000 0.0500 0.0500
0.27652 350 350 700 0.6500 0.6000 0.0500 0.0500
0.34064 450 450 900 0.6500 0.6000 0.0500 0.0500
0.40234 550 550 1100 0.6500 0.6000 0.0500 0.0500
0.46095 650 650 1300 0.6500 0.6000 0.0500 0.0500
0.18089 50 50 100 0.7000 0.6000 0.1000 0.0500
0.44240 150 150 300 0.7000 0.6000 0.1000 0.0500
0.65033 250 250 500 0.7000 0.6000 0.1000 0.0500
0.79333 350 350 700 0.7000 0.6000 0.1000 0.0500
0.88326 450 450 900 0.7000 0.6000 0.1000 0.0500
0.93640 550 550 1100 0.7000 0.6000 0.1000 0.0500
0.96636 650 650 1300 0.7000 0.6000 0.1000 0.0500
200-14
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
References
Chow, S.C., Shao, J., and Wang, H. 2008. Sample Size Calculations in Clinical Research, Second Edition.
Chapman & Hall/CRC. Boca Raton, Florida.
D'Agostino, R.B., Chase, W., and Belanger, A. 1988.'The Appropriateness of Some Common Procedures for Testing
the Equality of Two Independent Binomial Populations', The American Statistician, August 1988, Volume 42
Number 3, pages 198-202.
Fleiss, J. L., Levin, B., and Paik, M.C. 2003. Statistical Methods for Rates and Proportions. Third Edition.
John Wiley & Sons. New York.
Lachin, John M. 2000. Biostatistical Methods. John Wiley & Sons. New York.
Machin, D., Campbell, M., Fayers, P., and Pinol, A. 1997. Sample Size Tables for Clinical Studies, 2nd
Edition. Blackwell Science. Malden, Mass.
Ryan, Thomas P. 2013. Sample Size Determination and Power. John Wiley & Sons. Hoboken, New Jersey.
Report Definitions
Power is the probability of rejecting a false null hypothesis.
N1 and N2 are the number of items sampled from each population.
N is the total sample size, N1 + N2.
P1 is the proportion for Group 1 at which power and sample size calculations are made. This is the treatment
or experimental group.
P2 is the proportion for Group 2. This is the standard, reference, or control group.
D1 is the difference P1 - P2 assumed for power and sample size calcualtions.
Alpha is the probability of rejecting a true null hypothesis.
Summary Statements
Group sample sizes of 50 in group 1 and 50 in group 2 achieve 8.073% power to detect a
difference between the group proportions of 0.0500. The proportion in group 1 (the treatment
group) is assumed to be 0.6000 under the null hypothesis and 0.6500 under the alternative
hypothesis. The proportion in group 2 (the control group) is 0.6000. The test statistic used is
the two-sided Z-Test with pooled variance. The significance level of the test is 0.0500.
This report shows the values of each of the parameters, one scenario per row.
The values from this table are plotted in the chart below.
Plots Section
200-15
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
The values from the table are displayed on the above charts.
200-16
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
Setup (Proportions)
This section presents the values of each of the parameters needed to run this example. First, from the PASS Home
window, load the Tests for Two Proportions procedure window by expanding Proportions, then Two
Independent Proportions, then clicking on Test (Inequality), and then clicking on Tests for Two Proportions.
You may then make the appropriate entries as listed below, or open Example 2a by going to the File menu and
choosing Open Example Template.
Option Value
Design Tab
Solve For ................................................ Sample Size
Power Calculation Method ...................... Normal Approximation
Alternative Hypothesis ............................ Two-Sided
Test Type ................................................ Z-Test (Pooled)
Power ...................................................... 0.90
Alpha ....................................................... 0.05
Group Allocation ..................................... Equal (N1 = N2)
Input Type ............................................... Proportions
P1 (Group 1 Proportion|H1) .................... 0.54
P2 (Group 2 Proportion) ......................... 0.44
Output (Proportions)
Click the Calculate button to perform the calculations and generate the following output.
Numeric Results
Numeric Results for Testing Two Proportions using the Z-Test with Pooled Variance
H0: P1 - P2 = 0. H1: P1 - P2 = D1 ≠ 0.
The required sample size is 524 per group. These results use the large sample approximation. As an exercise,
change the Power Calculation Method to “Binomial Enumeration”. When this is done, the sample size is 521—
not much of a difference from the 524 that was found by approximate methods. The actual alpha is 0.0493 which
is very close to the target of 0.05.
200-17
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
Setup (Differences)
The setup for differences is exactly the same as that for proportions except for the following two inputs on the
Design tab. You may then make the appropriate entries as listed below, or open Example 2b by going to the File
menu and choosing Open Example Template.
Option Value
Design Tab
Input Type ............................................... Differences
D1 (Difference|H1 = P1–P2) ................... 0.10
Output (Differences)
Click the Calculate button to perform the calculations and generate the following output.
Numeric Results
Numeric Results for Testing Two Proportions using the Z-Test with Pooled Variance
H0: P1 - P2 = 0. H1: P1 - P2 = D1 ≠ 0.
This report shows the same sample size when the effect size is specified using the difference.
Setup (Ratios)
The setup for differences is exactly the same as that for proportions except for the following two inputs on the
Design tab. You may then make the appropriate entries as listed below, or open Example 2c by going to the File
menu and choosing Open Example Template.
If P1 = 0.54 and P2 = 0.44, then R1 = P1/P2 = 0.54/0.44 = 1.227272727.
Option Value
Design Tab
Input Type ............................................... Ratios
R1 (Ratio|H1 = P1/P2) ............................ 1.227272727
Output (Ratios)
Click the Calculate button to perform the calculations and generate the following output.
Numeric Results
Numeric Results for Testing Two Proportions using the Z-Test with Pooled Variance
H0: P1/P2 = 1 vs. H1: P1/P2 = R1 ≠ 1.
This report shows the same sample size when the effect size is specified using the ratio.
200-18
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
Numeric Results
Numeric Results for Testing Two Proportions using the Z-Test with Pooled Variance
H0: P1/P2 = 1 vs. H1: P1/P2 = R1 ≠ 1.
This report shows the same sample size when the effect size is specified using the odds ratio.
200-19
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
Setup
This section presents the values of each of the parameters needed to run this example. First, from the PASS Home
window, load the Tests for Two Proportions procedure window by expanding Proportions, then Two
Independent Proportions, then clicking on Test (Inequality), and then clicking on Tests for Two Proportions.
You may then make the appropriate entries as listed below, or open Example 3 by going to the File menu and
choosing Open Example Template.
Option Value
Design Tab
Solve For ................................................ Power
Power Calculation Method ...................... Binomial Enumeration
Max N1 or N2 for Binomial Enumeration 10000
Zero Count Adjustment Method .............. Add to zero cells only
Zero Count Adjustment Value ................ 0.0001
Alternative Hypothesis ............................ Two-Sided
Test Type ................................................ Z-Test (Pooled)
Alpha ....................................................... 0.05
Group Allocation ..................................... Equal (N1 = N2)
Sample Size Per Group .......................... 10 to 100 by 10
Input Type ............................................... Differences
D1 (Difference|H1 = P1–P2) ................... 0.2
P2 (Group 2 Proportion) ......................... 0.3
Reports Tab
Show Comparative Reports .................... Checked
Calculate Exact Test Results .................. Checked
Comparative Plots Tab
Show Comparative Plots ........................ Checked
200-20
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
Output
Click the Calculate button to perform the calculations and generate the following output.
It is interesting to note that the power of Fisher’s Exact Test and the z-test with continuity correction are
consistently lower than the other tests. This occurs because the actual alpha achieved by these tests is much lower
than that of the other tests. An interesting finding of this short study was that the regular t-test performed better
than the more popular z-test.
200-21
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
Setup
This section presents the values of each of the parameters needed to run this example. First, from the PASS Home
window, load the Tests for Two Proportions procedure window by expanding Proportions, then Two
Independent Proportions, then clicking on Test (Inequality), and then clicking on Tests for Two Proportions.
You may then make the appropriate entries as listed below, or open Example 4 by going to the File menu and
choosing Open Example Template.
Option Value
Design Tab
Solve For ................................................ Power
Power Calculation Method ...................... Normal Approximation
Alternative Hypothesis ............................ Two-Sided
Test Type ................................................ Z-Test (Pooled)
Alpha ....................................................... 0.05
Group Allocation ..................................... Equal (N1 = N2)
Sample Size Per Group .......................... 10 to 100 by 10
Input Type ............................................... Differences
D1 (Difference|H1 = P1–P2) ................... 0.2
P2 (Group 2 Proportion) ......................... 0.3
Reports Tab
Show Power Detail Report ..................... Checked
Output
Click the Calculate button to perform the calculations and generate the following output.
Notice that the approximate power values are pretty close to the binomial enumeration values for almost all
sample sizes.
200-22
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
Setup
This section presents the values of each of the parameters needed to run this example. First, from the PASS Home
window, load the Tests for Two Proportions procedure window by expanding Proportions, then Two
Independent Proportions, then clicking on Test (Inequality), and then clicking on Tests for Two Proportions.
You may then make the appropriate entries as listed below, or open Example 5 by going to the File menu and
choosing Open Example Template.
Option Value
Design Tab
Solve For ................................................ Power
Power Calculation Method ...................... Normal Approximation
Alternative Hypothesis ............................ Two-Sided
Test Type ................................................ Z-Test C.C. (Pooled)
Alpha ....................................................... 0.05
Group Allocation ..................................... Equal (N1 = N2)
Sample Size Per Group .......................... 100
Input Type ............................................... Differences
D1 (Difference|H1 = P1–P2) ................... 0.10
P2 (Group 2 Proportion) ......................... 0.40 to 0.60 by 0.04
200-23
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
Output
Click the Calculate button to perform the calculations and generate the following output.
Diff
Power* N1 N2 N P1 P2 D1 Alpha
0.24712 100 100 200 0.5000 0.4000 0.1000 0.0500
0.24518 100 100 200 0.5400 0.4400 0.1000 0.0500
0.24582 100 100 200 0.5800 0.4800 0.1000 0.0500
0.24909 100 100 200 0.6200 0.5200 0.1000 0.0500
0.25523 100 100 200 0.6600 0.5600 0.1000 0.0500
0.26477 100 100 200 0.7000 0.6000 0.1000 0.0500
This report shows the values of each of the parameters, one scenario per row. The power over the entire range of
the likely standard treatment proportions is relatively constant at about 0.25 to 0.26.
The values from this table are plotted in the chart below.
Plots Section
It is evident from these results that the test performed by the researchers had very low power to detect a difference
of 0.10 with the sample size used. The power is only about 0.25 or 0.26 for a large range of standard treatment
proportions.
200-24
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
Setup
This section presents the values of each of the parameters needed to run this example. First, from the PASS Home
window, load the Tests for Two Proportions procedure window by expanding Proportions, then Two
Independent Proportions, then clicking on Test (Inequality), and then clicking on Tests for Two Proportions.
You may then make the appropriate entries as listed below, or open Example 6 by going to the File menu and
choosing Open Example Template.
Option Value
Design Tab
Solve For ................................................ Sample Size
Power Calculation Method ...................... Normal Approximation
Alternative Hypothesis ............................ Two-Sided
Test Type ................................................ Likelihood Ratio Test
Power ...................................................... 0.80
Alpha ....................................................... 0.05
Group Allocation ..................................... Equal (N1 = N2)
Input Type ............................................... Ratios
R1 (Ratio|H1 = P1/P2) ............................ 3
P2 (Group 2 Proportion) ......................... 0.025
Output
Click the Calculate button to perform the calculations and generate the following output.
Numeric Results
Numeric Results for Testing Two Proportions using the Likelihood Ratio Test
H0: P1/P2 = 1 vs. H1: P1/P2 = R1 ≠ 1.
The researchers must sample 298 individuals from each population to achieve 80% power to detect a ratio of 3.0.
200-25
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
Setup
This section presents the values of each of the parameters needed to run this example. First, from the PASS Home
window, load the Tests for Two Proportions procedure window by expanding Proportions, then Two
Independent Proportions, then clicking on Test (Inequality), and then clicking on Tests for Two Proportions.
You may then make the appropriate entries as listed below, or open Example 7 by going to the File menu and
choosing Open Example Template.
Option Value
Design Tab
Solve For ................................................ Sample Size
Power Calculation Method ...................... Normal Approximation
Alternative Hypothesis ............................ One-Sided
Test Type ................................................ Z-Test (Pooled)
Power ...................................................... 0.80
Alpha ....................................................... 0.05
Group Allocation ..................................... Equal (N1 = N2)
Input Type ............................................... Differences
D1 (Difference|H1 = P1–P2) ................... 0.10
P2 (Group 2 Proportion) ......................... 0.55
Output
Click the Calculate button to perform the calculations and generate the following output.
Numeric Results
Numeric Results for Testing Two Proportions using the Z-Test with Pooled Variance
H0: P1 - P2 ≤ 0 vs. H1: P1 - P2 = D1 > 0.
PASS also found the required sample size to be 296 in each group.
200-26
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
Setup
This section presents the values of each of the parameters needed to run this example. First, from the PASS Home
window, load the Tests for Two Proportions procedure window by expanding Proportions, then Two
Independent Proportions, then clicking on Test (Inequality), and then clicking on Tests for Two Proportions.
You may then make the appropriate entries as listed below, or open Example 8 by going to the File menu and
choosing Open Example Template.
Option Value
Design Tab
Solve For ................................................ Sample Size
Power Calculation Method ...................... Normal Approximation
Alternative Hypothesis ............................ Two-Sided
Test Type ................................................ Z-Test (Unpooled)
Power ...................................................... 0.80
Alpha ....................................................... 0.05
Group Allocation ..................................... Equal (N1 = N2)
Input Type ............................................... Differences
D1 (Difference|H1 = P1–P2) ................... 0.20
P2 (Group 2 Proportion) ......................... 0.65
Output
Click the Calculate button to perform the calculations and generate the following output.
Numeric Results
Numeric Results for Testing Two Proportions using the Z-Test with Unpooled Variance
H0: P1 - P2 = 0. H1: P1 - P2 = D1 ≠ 0.
200-27
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
Setup
This section presents the values of each of the parameters needed to run this example. First, from the PASS Home
window, load the Tests for Two Proportions procedure window by expanding Proportions, then Two
Independent Proportions, then clicking on Test (Inequality), and then clicking on Tests for Two Proportions.
You may then make the appropriate entries as listed below, or open Example 9 by going to the File menu and
choosing Open Example Template.
Option Value
Design Tab
Solve For ................................................ Sample Size
Power Calculation Method ...................... Normal Approximation
Alternative Hypothesis ............................ Two-Sided
Test Type ................................................ Z-Test C.C. (Pooled)
Power ...................................................... 0.95 0.75
Alpha ....................................................... 0.01
Group Allocation ..................................... Equal (N1 = N2)
Input Type ............................................... Proportions
P1 (Group 1 Proportion|H1) .................... 0.70
P2 (Group 2 Proportion) ......................... 0.60
Output
Click the Calculate button to perform the calculations and generate the following output.
Numeric Results
Numeric Results for Testing Two Proportions using the Continuity Corrected Z-Test with Pooled Variance
H0: P1 - P2 = 0. H1: P1 - P2 = D1 ≠ 0.
PASS found the required sample sizes to be 500 and 827 which correspond to Fleiss, Levin, and Paik (2003) with
a slight difference due to rounding.
200-28
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
Tests for Two Proportions
Setup
This section presents the values of each of the parameters needed to run this example. First, from the PASS Home
window, load the Tests for Two Proportions procedure window by expanding Proportions, then Two
Independent Proportions, then clicking on Test (Inequality), and then clicking on Tests for Two Proportions.
You may then make the appropriate entries as listed below, or open Example 10 by going to the File menu and
choosing Open Example Template.
Option Value
Design Tab
Solve For ................................................ Sample Size
Power Calculation Method ...................... Normal Approximation
Alternative Hypothesis ............................ Two-Sided
Test Type ................................................ Z-Test C.C. (Pooled)
Power ...................................................... 0.95
Alpha ....................................................... 0.01
Group Allocation ..................................... Enter R = N2/N1, solve for N1 and N2
R (Sample Allocation Ratio) ................... 0.5
Input Type ............................................... Proportions
P1 (Group 1 Proportion|H1) .................... 0.25
P2 (Group 2 Proportion) ......................... 0.40
Output
Click the Calculate button to perform the calculations and generate the following output.
Numeric Results
Numeric Results for Testing Two Proportions using the Continuity Corrected Z-Test with Pooled Variance
H0: P1 - P2 = 0. H1: P1 - P2 = D1 ≠ 0.
PASS found the required sample sizes to be 531 and 266 which nearly corresponds to the results in Fleiss, Levin,
and Paik (2003). Fleiss, Levin, and Paik (2003) computed 530 instead of 531. The number 531 is correct because
the power for 530 is slightly less than the required 0.95.
200-29
© NCSS, LLC. All Rights Reserved.