Tutorials › Biostatistics › Sample Size for Proportions (Two-Sample)

Sample Size & Power

Sample Size for Proportions (Two-Sample)

A practical guide to calculating the sample size required to compare two independent proportions, including type I error, power, effect size, allocation ratios, continuity corrections, dropout inflation, and a complete clinical-trial worked example.

Intermediate 14 min read

What You'll Learn

  • How sample size is determined when comparing two independent proportions
  • How the expected proportions determine the required sample size
  • How type I error and power enter the sample-size calculation
  • How equal and unequal allocation affect sample size
  • How to inflate sample size for dropout and non-evaluable patients
  • How to implement and verify the calculation in R

Introduction

Many clinical trials compare two groups using a binary endpoint. Examples include the proportion of patients who achieve a clinical response, the proportion experiencing an adverse event, the proportion achieving remission, or the proportion meeting a predefined treatment-success criterion.

When the outcome is binary, the primary quantity of interest is often a proportion.

For example, suppose 60% of patients receiving an experimental treatment respond compared with 40% receiving control. The investigator may want to test whether this difference is statistically significant and, before the trial begins, determine how many patients are required to have adequate probability of detecting that difference.

This is the purpose of a two-sample proportion sample-size calculation.

Key idea: Sample size is determined by the expected difference between the two proportions, the type I error, the desired power, and the allocation of patients between the two groups.

The Basic Two-Sample Proportion Problem

Let:

  • \(p_1\) = true proportion in Group 1
  • \(p_2\) = true proportion in Group 2

The parameter of interest is usually the difference:

\[ \Delta=p_1-p_2 \]

The most common hypothesis is:

\[ H_0:p_1=p_2 \qquad\text{vs.}\qquad H_A:p_1\ne p_2 \]

For a one-sided study, the alternative may instead be:

\[ H_0:p_1\le p_2 \qquad\text{vs.}\qquad H_A:p_1>p_2 \]

The sample-size calculation requires investigators to specify the proportions they expect under the planning alternative.

Important: The sample-size calculation is not based on the observed proportions from the future study. It is based on prespecified planning values that represent the smallest or clinically meaningful treatment difference the study should be able to detect.

What Determines Sample Size?

Four major quantities drive the calculation:

  1. The expected proportion in Group 1.
  2. The expected proportion in Group 2.
  3. The type I error.
  4. The desired power.

Allocation between the groups also affects the total sample size.

Quantity Typical Planning Choice
Group 1 proportion \(p_1=0.60\)
Group 2 proportion \(p_2=0.40\)
Absolute difference 20 percentage points
Two-sided type I error 0.05
Power 0.80 or 0.90
Allocation 1:1

Absolute Difference Versus Relative Measures

For sample-size calculations, the most direct effect measure is the absolute difference in proportions:

\[ \Delta=p_1-p_2 \]

For example:

\[ 0.60-0.40=0.20 \]

The treatment difference is therefore 20 percentage points.

Other effect measures such as the relative risk and odds ratio can be useful for interpretation, but the standard two-sample proportion sample-size calculation is naturally expressed in terms of the two underlying proportions.

Why Smaller Effects Require Larger Samples

Suppose the experimental treatment is expected to have a 60% response rate and control a 40% response rate. The absolute difference is:

\[ \Delta=0.20 \]

Now suppose the expected difference is only 5 percentage points:

\[ \Delta=0.05 \]

The smaller effect is much harder to distinguish from random sampling variation.

General principle: The smaller the clinically meaningful difference that the study must detect, the larger the required sample size.

The Standard Normal Approximation

For planning purposes, a commonly used large-sample formula for equal allocation is based on the normal approximation to the two-sample test for proportions.

Let:

  • \(p_1\) = anticipated proportion in Group 1
  • \(p_2\) = anticipated proportion in Group 2
  • \(p=(p_1+p_2)/2\) = pooled planning proportion
  • \(z_{1-\alpha/2}\) = two-sided type I error critical value
  • \(z_{1-\beta}\) = power critical value

For equal sample sizes:

\[ n = \frac{ 2\left[ z_{1-\alpha/2}\sqrt{2p(1-p)} + z_{1-\beta}\sqrt{ p_1(1-p_1)+p_2(1-p_2) } \right]^2 }{ (p_1-p_2)^2 } \]

Here \(n\) is the required number of patients per group.

Be careful with notation: Some software and textbooks report the sample size per group, while others report the total sample size. Always verify which quantity is being displayed.

Where the Formula Comes From

The formula combines two sources of uncertainty.

The first term reflects the variability under the null hypothesis:

\[ \sqrt{2p(1-p)} \]

The second reflects the variability under the planning alternative:

\[ \sqrt{ p_1(1-p_1)+p_2(1-p_2) } \]

These quantities are multiplied by the relevant normal critical values.

The resulting quantity is then divided by the squared treatment difference:

\[ (p_1-p_2)^2 \]

This squared difference explains why sample size rises rapidly as the target effect becomes smaller.

Critical Values for Common Designs

Design Typical Value
Two-sided \(\alpha=0.05\) \(z_{1-\alpha/2}=1.96\)
One-sided \(\alpha=0.05\) \(z_{1-\alpha}=1.645\)
80% power \(z_{1-\beta}=0.842\)
90% power \(z_{1-\beta}=1.282\)
95% power \(z_{1-\beta}=1.645\)

A Complete Worked Example

Suppose a randomized clinical trial compares an experimental treatment with control using a binary response endpoint.

The investigators expect:

  • 60% of patients in the experimental group to respond.
  • 40% of patients in the control group to respond.

They want to detect this 20-percentage-point difference using a two-sided 5% type I error and 80% power.

Parameter Planning Value
Experimental proportion \(p_1\) 0.60
Control proportion \(p_2\) 0.40
Absolute difference 0.20
Two-sided \(\alpha\) 0.05
Power 0.80
Allocation 1:1

Step 1: Calculate the Planning Pooled Proportion

For equal allocation, calculate:

\[ p=\frac{p_1+p_2}{2} \]

Substituting the planning values:

\[ p=\frac{0.60+0.40}{2}=0.50 \]

Therefore:

\[ p(1-p)=0.50(0.50)=0.25 \]

and:

\[ \sqrt{2p(1-p)} = \sqrt{2(0.25)} = \sqrt{0.50} \approx0.7071 \]

Step 2: Calculate the Alternative Variance Component

The alternative variance component is:

\[ p_1(1-p_1)+p_2(1-p_2) \]

Substituting:

\[ (0.60)(0.40)+(0.40)(0.60) \]
\[ =0.24+0.24 = 0.48 \]

Therefore:

\[ \sqrt{0.48}\approx0.6928 \]

Step 3: Insert the Critical Values

For a two-sided 5% type I error:

\[ z_{1-\alpha/2}=1.96 \]

For 80% power:

\[ z_{1-\beta}\approx0.842 \]

The formula becomes:

\[ n = \frac{ 2\left[ (1.96)(0.7071) + (0.842)(0.6928) \right]^2 }{ (0.60-0.40)^2 } \]

Step 4: Calculate the Numerator

The first component is:

\[ (1.96)(0.7071)\approx1.386 \]

The second component is:

\[ (0.842)(0.6928)\approx0.583 \]

Their sum is approximately:

\[ 1.386+0.583=1.969 \]

Squaring gives approximately:

\[ 1.969^2\approx3.877 \]

Multiplying by 2:

\[ 2(3.877)\approx7.754 \]

Step 5: Divide by the Squared Difference

The treatment difference is:

\[ 0.60-0.40=0.20 \]

Therefore:

\[ (0.20)^2=0.04 \]

The approximate sample size per group is therefore:

\[ n\approx\frac{7.754}{0.04} \approx193.9 \]

Because sample size must be an integer, the normal-approximation calculation gives approximately:

\[ \boxed{n\approx194\text{ patients per group}} \]

The corresponding total sample size is:

\[ \boxed{N\approx388} \]
Planning result: Approximately 194 evaluable patients per group are required under this standard normal-approximation calculation to detect a difference between 60% and 40% with two-sided \(\alpha=0.05\) and 80% power under equal allocation.

Why Software May Give a Slightly Different Number

Different sample-size procedures can produce slightly different answers.

For two proportions, software may use:

  • Normal approximation without continuity correction
  • Normal approximation with continuity correction
  • Score-test-based calculations
  • Exact methods
  • Unconditional exact procedures
  • Alternative definitions of the planning variance

Therefore, two valid statistical programs may not return exactly the same sample size.

Best practice: Always document the method used to calculate sample size rather than reporting only the final integer.

Equal Allocation

The simplest design allocates the same number of patients to each treatment group.

\[ n_1=n_2 \]

For the worked example:

\[ n_1=n_2=194 \]

This produces a total evaluable sample size of:

\[ N=194+194=388 \]

Equal allocation is often statistically efficient when the per-patient cost, variability, and clinical importance of the two groups are similar.

Unequal Allocation

Clinical trials do not always use a 1:1 allocation ratio.

Suppose the investigator wants twice as many patients in the experimental group as in control:

\[ n_1:n_2=2:1 \]

This may occur because the experimental treatment is expected to provide greater clinical benefit, because additional safety information is desired, or because recruitment considerations favor one group.

Unequal allocation generally requires more total patients than equal allocation for the same statistical power, assuming all other factors remain constant.

General Formula for Unequal Allocation

Let:

  • \(n_1\) = sample size in Group 1
  • \(n_2\) = sample size in Group 2
  • \(r=n_1/n_2\) = allocation ratio

A commonly used normal-approximation expression can be written in terms of the allocation ratio.

One convenient representation is:

\[ n_1 = \frac{ \left[ z_{1-\alpha/2} \sqrt{ p_c(1-p_c)\left(1+\frac{1}{r}\right) } + z_{1-\beta} \sqrt{ p_1(1-p_1)+\frac{p_2(1-p_2)}{r} } \right]^2 }{ (p_1-p_2)^2 } \]

where \(n_1\) is the sample size in Group 1 and \(r=n_1/n_2\).

The sample size in Group 2 is then:

\[ n_2=\frac{n_1}{r} \]

The exact expression used by software depends on the statistical test and variance convention, so unequal-allocation calculations should be verified using the intended analysis method.

Effect of Allocation Ratio

Allocation General Consequence
1:1 Usually most statistically efficient
2:1 Usually requires somewhat more total patients
3:1 Further increase in total sample size
4:1 Increasingly inefficient statistically

The 1:1 ratio minimizes the total variance for a fixed total sample size when the two groups have comparable costs and variances.

Type I Error

The type I error is the probability of concluding that the two proportions differ when the null hypothesis is true.

For a two-sided test:

\[ \alpha=P(\text{reject }H_0\mid H_0\text{ true}) \]

A common clinical-trial choice is:

\[ \alpha=0.05 \]

The corresponding two-sided normal critical value is approximately:

\[ z_{1-\alpha/2}=1.96 \]

Power

Power is the probability of detecting the specified treatment difference if that difference truly exists.

\[ \text{Power} = P(\text{reject }H_0\mid p_1,p_2\text{ as specified}) \]

For an 80% powered study:

\[ 1-\beta=0.80 \]

so:

\[ \beta=0.20 \]

For 90% power:

\[ \beta=0.10 \]
Important: Power is always tied to a particular effect size. A study with 80% power to detect a 20-percentage-point difference does not necessarily have 80% power to detect a 10-percentage-point difference.

Two-Sided Versus One-Sided Testing

A two-sided test considers departures in either direction:

\[ H_A:p_1\ne p_2 \]

A one-sided test considers only one prespecified direction:

\[ H_A:p_1>p_2 \]

For the same nominal alpha and power, a one-sided calculation generally requires fewer patients because the critical value is smaller.

Do not choose one-sided testing simply to reduce sample size. The direction and testing framework should be justified scientifically and specified before the trial begins.

How Power Changes With Effect Size

Consider a control response rate of 40%.

Different experimental response rates correspond to different effect sizes:

Experimental Rate Control Rate Difference Difficulty
70% 40% 30 percentage points Relatively easier
60% 40% 20 percentage points Moderate
55% 40% 15 percentage points Harder
50% 40% 10 percentage points Much harder
45% 40% 5 percentage points Very difficult

As the difference becomes smaller, the required sample size increases substantially.

Sample Size Is Sensitive to the Planning Proportions

An important practical issue is that the sample-size calculation depends on the assumed values of \(p_1\) and \(p_2\).

Suppose investigators plan for:

\[ p_1=0.60,\qquad p_2=0.40 \]

but the true rates are actually closer together.

The study may then have substantially less power than intended.

Planning implication: The assumptions should be justified using previous trials, historical controls, pilot data, external evidence, or a clinically meaningful target difference—not selected merely because they produce a convenient sample size.

Clinically Meaningful Difference

A common mistake is to calculate the sample size around the largest difference that investigators hope to observe.

Instead, the calculation should generally focus on the smallest clinically important difference that the study should be able to detect.

For example, suppose a new treatment would be considered worthwhile if it increased response from 40% to at least 50%.

\[ \Delta=0.50-0.40=0.10 \]

The study should therefore be powered around a 10-percentage-point difference, rather than assuming a larger difference simply to reduce the required sample size.

Continuity Correction

The binomial distribution is discrete, whereas the normal approximation is continuous.

A continuity correction attempts to account for this difference.

For example, a difference of integer counts may be adjusted by approximately one-half observation when approximating the discrete binomial distribution with a normal distribution.

Continuity corrections can increase the required sample size.

Method Typical Characteristic
Uncorrected normal approximation Usually smaller sample size
Continuity-corrected approximation Often more conservative
Exact method Uses the discrete binomial distribution directly
Important: There is no single universal "correct" two-proportion sample-size number independent of the planned analysis. The method used for the sample-size calculation should correspond as closely as practical to the statistical test that will be used for the primary analysis.

Dropout Inflation

The sample size calculated from the statistical formula is often the number of evaluable patients required.

Clinical trials generally enroll more patients because some participants may:

  • Withdraw consent.
  • Be lost to follow-up.
  • Become unevaluable.
  • Fail to provide the primary endpoint.
  • Discontinue before the required assessment.

Suppose the required evaluable sample size is \(N\), and the anticipated dropout rate is \(d\).

The enrollment target can be inflated using:

\[ N_{\text{enroll}} = \frac{N}{1-d} \]

Dropout Example

Suppose the study requires:

\[ N=388 \]

evaluable patients and anticipates 10% dropout.

Then:

\[ N_{\text{enroll}} = \frac{388}{1-0.10} \]
\[ N_{\text{enroll}} = \frac{388}{0.90} \approx431.1 \]

Therefore, investigators would generally round upward to approximately:

\[ \boxed{432\text{ patients}} \]

With equal allocation, this could be implemented as:

\[ 216\text{ patients per group} \]

assuming the allocation remains exactly 1:1.

Do not subtract the dropout percentage from the sample size. A 10% dropout rate does not mean adding 10% to the sample size. The correct inflation is division by \(1-0.10\).

Why Simple Percentage Inflation Can Be Slightly Wrong

A common shortcut is:

\[ 388(1.10)=426.8 \]

This produces approximately 427 patients.

However, if 10% of the enrolled population is expected to drop out, the correct inflation is:

\[ \frac{388}{0.90}\approx431.1 \]

The difference occurs because the dropout percentage applies to the enrolled population, not to the final evaluable sample.

Event Rates Near 0% or 100%

The normal approximation deserves additional caution when proportions are close to zero or one.

For example:

\[ p_1=0.95,\qquad p_2=0.85 \]

or:

\[ p_1=0.05,\qquad p_2=0.01 \]

can produce conditions in which the standard normal approximation is less reliable.

In these situations, investigators should consider methods based directly on the binomial distribution or other appropriate procedures.

Rare Events

If the binary endpoint is rare, the number of observed events can be small even when the total sample size is substantial.

For example, an adverse-event rate of 2% versus 1% represents only a one-percentage-point difference.

The study may require a very large number of patients to reliably distinguish these rates.

Rare-event warning: When event rates are low, asymptotic normal approximations can be particularly sensitive to the assumptions used. Exact or specialized methods may be more appropriate depending on the study objective.

Risk Difference, Risk Ratio, and Odds Ratio

Although sample size is often planned using two proportions, the eventual analysis may report several effect measures.

Risk Difference

\[ RD=p_1-p_2 \]

Risk Ratio

\[ RR=\frac{p_1}{p_2} \]

Odds Ratio

\[ OR= \frac{ p_1/(1-p_1) }{ p_2/(1-p_2) } \]

For example, with:

\[ p_1=0.60,\qquad p_2=0.40 \]

the risk difference is:

\[ RD=0.20 \]

the risk ratio is:

\[ RR=\frac{0.60}{0.40}=1.50 \]

and the odds ratio is:

\[ OR= \frac{0.60/0.40}{0.40/0.60} = 2.25 \]

These are different descriptions of the same assumed pair of proportions.

Sample Size for a Non-Inferiority Study

Two-sample proportion calculations can also arise in non-inferiority trials.

The hypothesis structure changes because the goal is not necessarily to demonstrate superiority.

For example, if higher response is better and \(\delta\) is the acceptable non-inferiority margin, a simplified hypothesis might involve:

\[ H_0:p_T-p_C\le-\delta \] versus:
\[ H_A:p_T-p_C>-\delta \]

Non-inferiority sample-size calculations require careful attention to the direction of the endpoint, the margin, one-sided type I error, and the exact analysis method.

Do not reuse a superiority sample-size formula blindly for non-inferiority. The margin and hypothesis structure fundamentally change the calculation.

Power Versus Sample Size

Increasing the sample size generally increases power.

For example, suppose all other assumptions remain fixed.

Power Target Relative Sample Size
80% Baseline planning requirement
85% Higher
90% Higher still
95% Substantially higher

The relationship is not linear.

Moving from 80% to 90% power can require a meaningful increase in sample size, particularly when the target effect is modest.

Why 90% Power Is Common in Some Clinical Trials

An 80% power target corresponds to a 20% probability of failing to detect the specified effect under the planning alternative.

A 90% power target reduces this probability to 10%.

\[ \beta=0.20 \qquad\text{for 80\% power} \]

versus:

\[ \beta=0.10 \qquad\text{for 90\% power} \]

The appropriate target depends on the importance of the endpoint, regulatory expectations, consequences of a false-negative conclusion, feasibility, and other design considerations.

Sample Size and Multiplicity

If the trial has multiple primary hypotheses or multiple co-primary endpoints, the effective type I error allocation may differ from a simple 0.05 test.

For example, if a design allocates alpha across multiple hypotheses, the critical value entering the sample-size calculation may be different.

Important: The sample-size calculation should reflect the actual multiplicity strategy. Do not calculate every endpoint independently at \(\alpha=0.05\) if the final analysis uses an adjusted alpha allocation.

Clustered or Correlated Binary Outcomes

The standard two-sample proportion formula assumes independent observations.

That assumption may not hold in cluster-randomized trials, repeated binary measurements, or other correlated designs.

Correlation reduces the effective information contributed by each observation.

In a cluster-randomized study, a design effect may be applied, often involving the intracluster correlation coefficient (ICC) and cluster size.

\[ DE\approx1+(m-1)\rho \]

where:

  • \(m\) = average cluster size
  • \(\rho\) = intracluster correlation coefficient

The resulting sample size can be substantially larger than the independent two-sample calculation.

Stratification and Covariate Adjustment

Randomized trials often use stratification or covariate-adjusted analyses.

The simple two-proportion calculation provides a useful baseline, but the actual analysis may be based on:

  • Cochran–Mantel–Haenszel methods
  • Logistic regression
  • Stratified risk differences
  • Adjusted risk ratios
  • Other prespecified covariate-adjusted models

If the primary analysis differs materially from the simple unadjusted two-proportion comparison, the sample-size method should be evaluated to ensure that it provides adequate power for the intended analysis.

R Implementation

R provides several ways to perform two-sample proportion sample-size calculations.

A standard starting point is the built-in power.prop.test() function.

power.prop.test(
  p1 = 0.60,
  p2 = 0.40,
  power = 0.80,
  sig.level = 0.05,
  alternative = "two.sided"
)

This function returns the required approximate sample size per group under its specified method.

Solving for Sample Size Directly

The same function can be used without specifying the sample size.

result <- power.prop.test(
  p1 = 0.60,
  p2 = 0.40,
  power = 0.80,
  sig.level = 0.05,
  alternative = "two.sided"
)

result

The output includes the calculated sample size along with the other planning parameters.

Checking the Result

A good practice is to verify the result using a second calculation.

p1 <- 0.60
p2 <- 0.40
alpha <- 0.05
power_target <- 0.80

z_alpha <- qnorm(1 - alpha / 2)
z_beta <- qnorm(power_target)

p_bar <- (p1 + p2) / 2

n <-
  2 *
  (
    z_alpha * sqrt(2 * p_bar * (1 - p_bar)) +
    z_beta * sqrt(
      p1 * (1 - p1) +
      p2 * (1 - p2)
    )
  )^2 /
  (p1 - p2)^2

ceiling(n)

This reproduces the approximate normal-theory calculation described earlier.

Creating a Reusable R Function

For repeated sample-size calculations, it is useful to create a function.

two_prop_n <- function(
  p1,
  p2,
  alpha = 0.05,
  power = 0.80
) {

  z_alpha <- qnorm(1 - alpha / 2)
  z_beta <- qnorm(power)

  p_bar <- (p1 + p2) / 2

  n <-
    2 *
    (
      z_alpha * sqrt(2 * p_bar * (1 - p_bar)) +
      z_beta * sqrt(
        p1 * (1 - p1) +
        p2 * (1 - p2)
      )
    )^2 /
    (p1 - p2)^2

  ceiling(n)
}

two_prop_n(
  p1 = 0.60,
  p2 = 0.40,
  alpha = 0.05,
  power = 0.80
)

Exploring Different Effect Sizes in R

One of the most useful applications is to see how sample size changes as the target effect changes.

control <- 0.40

experimental_rates <-
  c(0.45, 0.50, 0.55, 0.60, 0.65, 0.70)

sample_sizes <- sapply(
  experimental_rates,
  function(p1) {
    two_prop_n(
      p1 = p1,
      p2 = control,
      alpha = 0.05,
      power = 0.80
    )
  }
)

data.frame(
  experimental_rate = experimental_rates,
  control_rate = control,
  difference = experimental_rates - control,
  n_per_group = sample_sizes,
  total_n = 2 * sample_sizes
)

This table demonstrates an important planning concept: small changes in the target effect size can produce large changes in the required sample size.

Exploring Power in R

After selecting a sample size, investigators can calculate the resulting power for different true treatment effects.

p1_values <- c(
  0.45,
  0.50,
  0.55,
  0.60,
  0.65,
  0.70
)

power_values <- sapply(
  p1_values,
  function(p1) {

    power.prop.test(
      p1 = p1,
      p2 = 0.40,
      n = 194,
      sig.level = 0.05,
      alternative = "two.sided"
    )$power
  }
)

data.frame(
  p1 = p1_values,
  p2 = 0.40,
  power = power_values
)

This is useful because the study's actual power is not a single universal number. It depends on the true underlying proportions.

Power as a Function of the True Difference

Define:

\[ \pi(p_1,p_2) = P(\text{reject }H_0\mid p_1,p_2) \]

The resulting power surface depends on both proportions.

For a fixed control proportion, power generally increases as the experimental proportion moves farther away from the control value.

Interpretation: If a study is designed for 80% power to detect a 20-percentage-point difference, it will generally have less than 80% power for smaller differences and more than 80% power for larger differences.

Sample Size Sensitivity Analysis

A strong statistical analysis plan should not rely on only one arbitrary planning scenario.

Investigators can evaluate a range of assumptions.

Scenario \(p_1\) \(p_2\) Difference Planning Question
Optimistic 0.65 0.40 25% What if treatment effect is large?
Primary 0.60 0.40 20% Main design assumption
Conservative 0.55 0.40 15% What if effect is smaller?
Very conservative 0.50 0.40 10% What if effect is modest?

Such sensitivity analyses help the study team understand how robust the enrollment requirement is to uncertainty in the assumptions.

Choosing the Planning Proportions

Sources of information can include:

  • Previous randomized clinical trials
  • Historical control data
  • Phase I or Phase II studies
  • Published literature
  • Real-world data
  • Pilot studies
  • Clinical expert judgment
  • Regulatory or development-program objectives

Historical data should be interpreted carefully because response rates can change across populations, endpoint definitions, treatment lines, follow-up periods, and assessment criteria.

The Control Rate Is Especially Important

Suppose the experimental treatment is expected to have a 60% response rate.

If the control rate is assumed to be 30%, the expected difference is:

\[ 0.60-0.30=0.30 \]

But if the control rate is expected to be 50%, the difference is only:

\[ 0.60-0.50=0.10 \]

These scenarios can require dramatically different sample sizes.

Clinical implication: The sample-size calculation should use a realistic control response rate. An overly optimistic control assumption can result in an underpowered study.

Unequal Group Costs

Statistical efficiency is not the only consideration when choosing an allocation ratio.

Suppose one treatment is substantially more expensive than another. An investigator may prefer unequal allocation even though it requires more total patients.

The design therefore involves a tradeoff between:

  • Statistical efficiency
  • Treatment exposure
  • Cost
  • Safety information
  • Recruitment feasibility
  • Ethical considerations

Ethical Considerations

Sample-size planning is also an ethical issue.

An underpowered study can expose participants to an experimental intervention without a reasonable probability of answering the scientific question.

An unnecessarily oversized study can expose more participants than necessary.

Good design balances both risks: The goal is not simply to minimize sample size. The goal is to enroll enough participants to provide scientifically credible evidence while avoiding unnecessary enrollment.

Interim Analyses and Sample Size Re-Estimation

Some trials allow sample-size re-estimation during the study.

For example, investigators may update an estimate of the nuisance parameter or reassess assumptions about event rates.

However, unplanned changes based on observed treatment differences can affect type I error and should not be treated as a simple administrative adjustment.

If adaptive sample-size re-estimation is planned, its statistical properties should be established in advance.

Missing Data

The standard formula assumes that the analyzed observations contribute valid binary outcomes.

Missing primary endpoint data can reduce the effective sample size.

The protocol and statistical analysis plan should therefore define:

  • What constitutes an evaluable patient
  • How missing responses are handled
  • Whether replacement is permitted
  • How intercurrent events affect the endpoint
  • Which analysis population is primary

The dropout inflation should be consistent with the assumptions used in the analysis.

Intention-to-Treat Versus Per-Protocol

In randomized trials, binary endpoints may be analyzed using different populations.

An intention-to-treat analysis generally includes patients according to their randomized treatment assignment.

A per-protocol analysis may exclude certain protocol deviations.

If the primary analysis is based on intention-to-treat, the sample-size calculation should be interpreted in terms of the expected endpoint availability in that population.

Common Mistakes

  1. Using the wrong effect size. Sample size should be based on the smallest clinically meaningful difference, not simply the largest anticipated difference.
  2. Confusing total sample size with sample size per group. Always verify what the formula or software reports.
  3. Forgetting dropout inflation. The statistical calculation often describes evaluable patients rather than patients who must be randomized.
  4. Using a two-sided formula for a one-sided design or vice versa. The critical value must match the planned hypothesis test.
  5. Choosing a one-sided test merely to obtain a smaller sample size. The testing direction must be scientifically justified.
  6. Ignoring unequal allocation. The allocation ratio affects statistical efficiency.
  7. Assuming the normal approximation is always appropriate. Rare events and proportions near 0 or 1 may require more careful methods.
  8. Ignoring multiplicity. Multiple primary hypotheses may require an adjusted alpha allocation.
  9. Using unrealistic response-rate assumptions. Poor assumptions can result in a study that is underpowered or unnecessarily large.
  10. Reporting only the final sample size. The statistical method, assumptions, alpha, power, allocation, and dropout assumptions should also be documented.

A Practical Two-Sample Proportion Workflow

1
Define the primary binary endpoint.
2
Determine whether the primary hypothesis is superiority, non-inferiority, or another comparison.
3
Specify the expected proportion in each treatment group.
4
Define the clinically meaningful difference to be detected.
5
Specify the type I error and whether testing is one-sided or two-sided.
6
Specify the desired statistical power.
7
Specify the treatment allocation ratio.
8
Select the sample-size method consistent with the planned primary analysis.
9
Calculate the required evaluable sample size.
10
Inflate for anticipated dropout or non-evaluable patients.
11
Round upward while preserving the intended allocation ratio.
12
Perform sensitivity analyses across plausible response-rate assumptions.

What Should Be Reported in the Protocol?

A reproducible sample-size section should specify at least:

  • Primary endpoint
  • Statistical hypothesis
  • Expected proportion in each group
  • Clinically meaningful difference
  • Type I error
  • One-sided or two-sided testing
  • Target power
  • Allocation ratio
  • Sample-size calculation method
  • Continuity correction, if applicable
  • Required evaluable sample size
  • Expected dropout rate
  • Total enrollment target
  • Any adjustment for multiplicity
  • Any inflation for clustering or other design effects

Worked Example Summary

The main example can be summarized as follows.

Component Value
Endpoint Binary response
Experimental response rate 60%
Control response rate 40%
Absolute difference 20 percentage points
Two-sided type I error 5%
Target power 80%
Allocation 1:1
Approximate evaluable N per group 194
Approximate evaluable total N 388
Dropout assumption 10%
Approximate enrollment total after inflation 432
Approximate enrollment per group 216

The Most Important Concept

The most important idea in two-sample proportion sample-size planning is that sample size is driven by the signal you need to distinguish from random variation.

The signal is the difference:

\[ \Delta=p_1-p_2 \]

The statistical noise depends on the proportions themselves, the allocation ratio, and the sample size.

The study must be large enough that the anticipated clinically meaningful difference can be detected with the desired probability while maintaining the specified type I error.

In practical terms:

  • Larger treatment differences require fewer patients.
  • Smaller treatment differences require more patients.
  • Higher power requires more patients.
  • Smaller alpha requires more patients.
  • Unequal allocation generally requires more total patients.
  • Dropout increases the enrollment target.
  • Rare events require particular care with asymptotic methods.
Bottom line: For two independent proportions, sample size is determined primarily by the two planning proportions, the clinically meaningful difference between them, the type I error, desired power, and allocation ratio. A standard normal approximation provides a useful starting point, but the final calculation should reflect the exact statistical method planned for the primary analysis. After determining the required evaluable sample size, investigators should inflate for dropout and assess sensitivity to realistic alternative assumptions.

References

Fleiss, J.L., Tytun, A. & Ury, H.K. (1980). A simple approximation for calculating sample sizes for comparing independent proportions. Biometrics, 36(2), 343–346.
Fleiss, J.L., Levin, B. & Paik, M.C. (2003). Statistical Methods for Rates and Proportions. 3rd ed. Wiley.
Chow, S.-C., Shao, J., Wang, H. & Lokhnygina, Y. (2017). Sample Size Calculations in Clinical Research. 3rd ed. CRC Press.
Julious, S.A. (2009). Sample Sizes for Clinical Trials. Chapman & Hall/CRC.
Agresti, A. (2013). Categorical Data Analysis. 3rd ed. Wiley.
Newcombe, R.G. (1998). Interval estimation for the difference between independent proportions: comparison of eleven methods. Statistics in Medicine, 17, 873–890.