Tutorials › Biostatistics › Sample Size for Two-Sample t-Tests

Sample Size & Power

Sample Size for Two-Sample t-Tests: A Worked Example

A practical guide to calculating sample size for comparing two independent means, including effect size, pooled standard deviation, type I error, power, equal allocation, attrition, a complete worked example, and R implementation.

Intermediate 14 min read

What You'll Learn

  • How a two-sample t-test compares two independent means
  • How the clinically meaningful difference and standard deviation determine sample size
  • How type I error and power affect the required number of patients
  • How to calculate sample size for equal and unequal allocation
  • How to inflate the sample size for dropout and non-evaluable patients
  • How to implement the calculation in R and interpret the result

Introduction

Many clinical trials compare the mean value of a continuous endpoint between two independent treatment groups.

Examples include change from baseline in:

  • Blood pressure
  • Cholesterol
  • Biomarker concentrations
  • Pain scores
  • Lung function
  • Quality-of-life measurements
  • Other continuous clinical or laboratory endpoints

When the primary analysis compares two independent means, a two-sample t-test is one of the standard statistical methods for testing whether the population means differ.

Before the study begins, however, investigators must determine how many patients are required.

The sample size depends primarily on four statistical quantities:

1
Effect size: the difference between the two population means that the study should be able to detect.
2
Variability: the expected standard deviation of the endpoint.
3
Type I error: the probability of a false-positive conclusion.
4
Power: the probability of detecting the planned effect if it is truly present.
Key idea: Sample size is fundamentally a signal-to-noise problem. A larger clinically meaningful difference requires fewer patients, while greater variability requires more patients.

The Two-Sample t-Test

Suppose there are two independent groups:

  • Group 1 has population mean \(\mu_1\)
  • Group 2 has population mean \(\mu_2\)

The parameter of interest is usually the difference:

$$ \Delta=\mu_1-\mu_2 $$

For a two-sided test, the hypotheses are:

$$ H_0:\mu_1-\mu_2=0 \qquad\text{vs.}\qquad H_A:\mu_1-\mu_2\ne0 $$

For a one-sided test in which Group 1 is expected to have a larger mean:

$$ H_0:\mu_1-\mu_2\le0 \qquad\text{vs.}\qquad H_A:\mu_1-\mu_2>0 $$

The sample size calculation is based on the difference that the investigators consider clinically meaningful, not necessarily the smallest difference that could be statistically significant.

What Does "Clinically Meaningful Difference" Mean?

Let:

$$ \Delta = |\mu_1-\mu_2| $$

represent the absolute difference that the study should be powered to detect.

For example, suppose a treatment is expected to reduce systolic blood pressure by 5 mmHg more than control.

Then:

$$ \Delta=5\text{ mmHg} $$

The sample size calculation asks: How many patients are required to have adequate power to detect a 5 mmHg difference?

Important: The planned effect should be justified clinically. Choosing an unrealistically large difference simply to obtain a small sample size can produce an underpowered study.

The Role of Standard Deviation

The second major input is the expected standard deviation.

Let:

$$ \sigma $$

denote the assumed common standard deviation when equal variances are used for planning.

If:

$$ \sigma=10 $$

and the clinically meaningful difference is:

$$ \Delta=5 $$

then the signal-to-noise ratio is:

$$ \frac{\Delta}{\sigma} = \frac{5}{10} = 0.50 $$

This standardized difference is commonly called Cohen's \(d\):

$$ d=\frac{\Delta}{\sigma} $$

A larger \(d\) means the treatment difference is large relative to the background variability.

Cohen's d

Cohen's standardized effect size is:

$$ d = \frac{|\mu_1-\mu_2|}{\sigma} $$

For equal-variance planning, a commonly used rough interpretation is:

Cohen's d Approximate Interpretation
0.20 Small effect
0.50 Moderate effect
0.80 Large effect

These labels are only general reference points. In a clinical trial, the clinically meaningful difference should be defined from subject-matter considerations rather than from Cohen's labels.

The Basic Sample Size Formula

For two independent groups with equal sample sizes and a common planning standard deviation, a widely used normal-approximation formula is:

$$ n = \frac{ 2\sigma^2 \left( z_{1-\alpha/2} + z_{1-\beta} \right)^2 }{ \Delta^2 } $$

where \(n\) is the required sample size per group.

Here:

Symbol Meaning
\(n\) Sample size per group
\(\sigma\) Assumed common standard deviation
\(\Delta\) Clinically meaningful absolute difference
\(\alpha\) Type I error
\(\beta\) Type II error
\(1-\beta\) Power
\(z_{1-\alpha/2}\) Standard normal critical value for a two-sided test
\(z_{1-\beta}\) Standard normal quantile associated with desired power
Practical point: The formula gives the basic planning result. Software may use the exact noncentral t distribution rather than the normal approximation, producing a slightly different value.

Why the Formula Contains a Factor of 2

For two independent groups with equal sample sizes:

$$ \operatorname{Var}(\bar X_1-\bar X_2) = \frac{\sigma^2}{n} + \frac{\sigma^2}{n} = \frac{2\sigma^2}{n} $$

The difference between two independent means therefore has twice the per-group variance contribution.

This leads to the factor of 2 in the equal-allocation sample size formula.

Two-Sided Versus One-Sided Tests

The choice of sidedness affects sample size.

For a two-sided test with significance level \(\alpha\):

$$ z_{1-\alpha/2} $$

is used.

For a one-sided test:

$$ z_{1-\alpha} $$

is used instead.

Design Critical Quantile
Two-sided \(\alpha=0.05\) \(z_{0.975}=1.96\)
One-sided \(\alpha=0.05\) \(z_{0.95}=1.645\)

Because the one-sided critical value is smaller, a one-sided design generally requires fewer patients for the same power and effect size.

Do not choose one-sided testing simply to reduce sample size. The direction of the hypothesis should be scientifically justified before the study begins.

Power and Type II Error

Power is:

$$ \text{Power}=1-\beta $$

Common target power values include:

  • 80%
  • 85%
  • 90%
  • 95%

For example, 80% power means that if the true treatment difference equals the planned effect, the study has approximately an 80% probability of producing a statistically significant result under the specified analysis assumptions.

The corresponding type II error is:

$$ \beta=1-\text{Power} $$

Thus, 80% power corresponds to:

$$ \beta=0.20 $$

How Sample Size Changes With Power

Higher power requires more patients.

For a two-sided test with \(\alpha=0.05\):

Power \(z_{1-\beta}\) Relative Sample Size
80% 0.842 Baseline
90% 1.282 Larger
95% 1.645 Still larger

The relationship is not linear. Because the relevant quantity is the square of the sum of the two critical values, moving from 80% to 90% power can require a substantial increase in sample size.

A Complete Worked Example

Suppose a randomized clinical trial compares a new treatment with placebo using a continuous primary endpoint.

The investigators expect:

  • A clinically meaningful treatment difference of 5 units
  • A common standard deviation of 10 units
  • A two-sided type I error of 5%
  • 80% power
  • Equal allocation to the two groups
Parameter Planning Value
Expected treatment difference \(\Delta\) 5 units
Common standard deviation \(\sigma\) 10 units
Standardized effect \(d\) 0.50
Two-sided \(\alpha\) 0.05
Power 80%
Allocation 1:1

Step 1: Calculate the Standardized Effect Size

The standardized effect is:

$$ d = \frac{\Delta}{\sigma} $$

Substituting the planning values:

$$ d = \frac{5}{10} = 0.50 $$

Thus, the study is designed to detect a moderate standardized difference of 0.50.

Step 2: Identify the Critical Values

For a two-sided test with:

$$ \alpha=0.05 $$

the standard normal critical value is:

$$ z_{1-\alpha/2} = z_{0.975} \approx1.96 $$

For 80% power:

$$ z_{1-\beta} = z_{0.80} \approx0.842 $$

Step 3: Apply the Formula

The equal-allocation formula is:

$$ n = \frac{ 2\sigma^2 \left( z_{1-\alpha/2}+z_{1-\beta} \right)^2 }{ \Delta^2 } $$

Substitute:

$$ n = \frac{ 2(10^2)(1.96+0.842)^2 }{ 5^2 } $$

Therefore:

$$ n = \frac{ 200(2.802)^2 }{ 25 } $$

which gives approximately:

$$ n\approx63.77 $$

Because sample size must be an integer, round up:

$$ \boxed{n=64\text{ patients per group}} $$

Therefore, the total analyzable sample size is:

$$ \boxed{N=128} $$
Worked-example result: Approximately 64 evaluable patients per treatment group, or 128 evaluable patients in total, are required to detect a 5-unit difference with a standard deviation of 10, using a two-sided 5% test and 80% power.

Step 4: Verify the Effect Size

The calculation can also be expressed entirely in terms of Cohen's \(d\):

$$ n = \frac{ 2 \left( z_{1-\alpha/2}+z_{1-\beta} \right)^2 }{ d^2 } $$

For \(d=0.50\):

$$ n = \frac{ 2(1.96+0.842)^2 }{ 0.50^2 } $$
$$ n\approx63.77 $$

Again, this rounds to:

$$ \boxed{64\text{ per group}} $$

Why We Round Up

Suppose the calculation produces:

$$ n=63.01 $$

The study cannot enroll 63.01 patients.

Rounding down to 63 would produce slightly less power than the calculated target.

Therefore, sample size calculations should generally be rounded upward:

$$ n_{\text{final}} = \lceil n_{\text{calculated}}\rceil $$

where \(\lceil\cdot\rceil\) denotes the ceiling function.

Analyzable Sample Size vs. Enrollment Sample Size

The 128 patients calculated above are the number of patients expected to provide usable primary endpoint information.

Real trials may experience:

  • Dropout
  • Withdrawal
  • Loss to follow-up
  • Missing endpoint measurements
  • Protocol deviations affecting analysis eligibility
  • Other forms of non-evaluability

If 10% of randomized patients are expected to be lost or otherwise non-evaluable, simply adding 10% is not mathematically correct.

Instead, divide by the expected retention proportion.

Inflating for 10% Attrition

Suppose the expected attrition rate is:

$$ q=0.10 $$

The expected retention rate is:

$$ 1-q=0.90 $$

Therefore:

$$ N_{\text{enroll}} = \frac{N_{\text{analyzable}}}{1-q} $$

For the worked example:

$$ N_{\text{enroll}} = \frac{128}{0.90} = 142.22 $$

Rounding up gives:

$$ \boxed{N_{\text{enroll}}=144} $$

With equal allocation, this means:

$$ \boxed{72\text{ patients per group}} $$
Important: A 10% dropout rate does not mean adding 10% to the sample size. Dividing by 0.90 accounts for the fact that the dropout percentage applies to the number enrolled.

Common Attrition Adjustments

Expected Attrition Retention Inflation Factor
5% 95% 1.053
10% 90% 1.111
15% 85% 1.176
20% 80% 1.250
25% 75% 1.333

How Effect Size Drives Sample Size

From the sample size formula:

$$ n \propto \frac{1}{\Delta^2} $$

when the standard deviation and other design parameters are fixed.

This squared relationship is extremely important.

If the planned effect is cut in half, the required sample size approximately quadruples.

Effect Size \(d\) Approximate N Per Group*
0.20 Approximately 394
0.30 Approximately 176
0.40 Approximately 99
0.50 Approximately 64
0.60 Approximately 45
0.80 Approximately 25

*Values are approximate normal-approximation results for a two-sided \(\alpha=0.05\) test and 80% power and may differ slightly from exact noncentral-t calculations.

How Variability Drives Sample Size

The sample size formula contains:

$$ n\propto\sigma^2 $$

Therefore, doubling the standard deviation approximately quadruples the required sample size if the clinically meaningful difference remains fixed.

This is why reliable estimates of endpoint variability are so important during study planning.

Sources of the Standard Deviation

The planning standard deviation may come from:

  • Previous randomized trials
  • Pilot studies
  • Published literature
  • Internal historical data
  • Earlier phases of the development program
  • External databases or registries

The source should be scientifically defensible and reasonably comparable to the planned study population, endpoint definition, and analysis time point.

Planning uncertainty matters: If the assumed standard deviation is too small, the resulting sample size may be insufficient. Sensitivity analyses over a plausible range of standard deviations can be useful during protocol development.

Sample Size Sensitivity Analysis

Suppose the planned difference remains 5 units but the standard deviation is uncertain.

SD Effect Difference Approximate N Per Group
8 5 Approximately 41
10 5 Approximately 64
12 5 Approximately 92
14 5 Approximately 125

This illustrates why the variability assumption deserves as much attention as the treatment effect assumption.

Equal Allocation

The standard formula assumes equal allocation:

$$ n_1=n_2=n $$

For example:

$$ 64:64 $$

Equal allocation is statistically efficient when the per-patient cost and variance are approximately comparable between groups.

It is also operationally simple and is common in randomized clinical trials.

Unequal Allocation

Sometimes investigators deliberately use an allocation ratio other than 1:1.

Suppose:

$$ \frac{n_2}{n_1}=k $$

where \(k\) is the ratio of the second group's sample size to the first group's sample size.

For two independent groups with common variance, the variance of the difference is:

$$ \operatorname{Var}(\bar X_1-\bar X_2) = \sigma^2 \left( \frac{1}{n_1}+\frac{1}{n_2} \right) $$

If \(n_2=kn_1\), then:

$$ \operatorname{Var}(\bar X_1-\bar X_2) = \frac{\sigma^2}{n_1} \left( 1+\frac{1}{k} \right) $$

The corresponding normal-approximation sample size for Group 1 is:

$$ n_1 = \frac{ \sigma^2 \left( z_{1-\alpha/2}+z_{1-\beta} \right)^2 \left(1+\frac{1}{k}\right) }{ \Delta^2 } $$

and:

$$ n_2=kn_1 $$

Why Equal Allocation Is Usually Efficient

For a fixed total sample size, equal allocation minimizes:

$$ \frac{1}{n_1}+\frac{1}{n_2} $$

when the two groups have the same variance and per-patient information.

Thus, a 1:1 allocation generally provides the greatest power for a fixed total number of patients.

Unequal allocation may still be justified. Examples include different treatment costs, ethical considerations, different event or information rates, or a desire to collect more safety information in one group.

When the Two Groups Have Different Variances

The equal-variance calculation assumes:

$$ \sigma_1^2=\sigma_2^2 $$

In practice, the two groups may have different variances.

A Welch two-sample t-test does not require the equal-variance assumption.

For sample size planning, investigators can use expected values \(\sigma_1\) and \(\sigma_2\) and calculate the variance of the treatment difference as:

$$ \operatorname{Var}(\bar X_1-\bar X_2) = \frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2} $$

The general principle remains the same: sample size must be large enough that the planned treatment difference is distinguishable from the expected sampling variability.

Two-Sample t-Test vs. Paired t-Test

A common source of sample size errors is confusing an independent two-sample design with a paired design.

A two-sample t-test is appropriate when the observations in the two groups are independent.

Examples include:

  • Drug versus placebo in different patients
  • Treatment A versus Treatment B in different patients
  • Two independent patient cohorts

A paired t-test is appropriate when observations are naturally paired.

Examples include:

  • Before versus after measurements on the same patient
  • Matched subjects
  • Repeated measurements that have been reduced to within-subject differences
Feature Two-Sample t-Test Paired t-Test
Observations Independent Paired
Primary variability Between-group variability Within-pair difference variability
Typical comparison Treatment vs control Before vs after
Sample size unit Patients per group Pairs
Do not use the two-sample formula for a paired study. The paired design can require substantially fewer subjects because the analysis can remove between-subject variability.

Power Is Based on the True Effect

Suppose the study is powered for:

$$ \Delta=5 $$

and the true difference is actually only 3 units.

The study does not still have 80% power for the 3-unit effect.

The power calculation is tied to the effect size used for planning.

In general:

$$ \text{Power} = P(\text{reject }H_0\mid\Delta=\Delta_{\text{true}}) $$

and power changes as the true effect changes.

Power Across Possible Effect Sizes

For the worked example, the study is designed around a standardized effect of \(d=0.50\).

A smaller true effect will generally have lower power, while a larger true effect will generally have higher power.

True Standardized Effect Qualitative Power
0.20 Low
0.30 Below target
0.40 Intermediate
0.50 Approximately 80%
0.60 Higher than target
0.80 Substantially higher

This is why a power calculation should always state the effect size for which power is being evaluated.

The t Distribution and Exact Sample Size

The simple formula uses standard normal quantiles.

A more exact calculation uses the noncentral t distribution because the two-sample t-test uses a t statistic and estimates the variance from the data.

For equal group sizes, the degrees of freedom under the conventional pooled two-sample t-test are:

$$ df=n_1+n_2-2 $$

The exact power is determined by the noncentrality parameter:

$$ \lambda = \frac{\Delta} {\sigma\sqrt{\frac{1}{n_1}+\frac{1}{n_2}}} $$

For equal allocation:

$$ \lambda = \frac{\Delta} {\sigma\sqrt{\frac{2}{n}}} = d\sqrt{\frac{n}{2}} $$

The exact calculation evaluates the probability that the noncentral t statistic falls beyond the appropriate critical value.

Practical recommendation: For final protocol sample-size determination, use validated statistical software based on the exact analysis intended for the trial rather than relying solely on a hand-calculated normal approximation.

R Implementation With pwr

The R package pwr provides a convenient function for two-sample t-test power calculations.

install.packages("pwr")
library(pwr)

pwr.t.test(
  d = 0.50,
  sig.level = 0.05,
  power = 0.80,
  type = "two.sample",
  alternative = "two.sided"
)

The key inputs are:

  • d = 0.50: standardized effect size
  • sig.level = 0.05: type I error
  • power = 0.80: desired power
  • type = "two.sample": independent two-sample test
  • alternative = "two.sided": two-sided hypothesis

The resulting continuous sample-size estimate is approximately:

n = 63.76576

Thus:

$$ \boxed{64\text{ patients per group}} $$

R Implementation Using the Planning Formula

The normal-approximation calculation can also be written directly in R.

alpha <- 0.05
power <- 0.80

delta <- 5
sigma <- 10

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

n_per_group <-
  2 * sigma^2 *
  (z_alpha + z_beta)^2 /
  delta^2

ceiling(n_per_group)

The result is:

# 64

Therefore the total analyzable sample size is:

2 * ceiling(n_per_group)

# 128

Exact Power for 64 Patients Per Group

The exact power can be evaluated using the noncentral t distribution.

n <- 64
delta <- 5
sigma <- 10
alpha <- 0.05

df <- 2 * n - 2

lambda <-
  delta /
  (sigma * sqrt(2 / n))

tcrit <- qt(1 - alpha / 2, df)

power_exact <-
  pt(-tcrit, df, ncp = lambda) +
  pt(tcrit, df, ncp = lambda, lower.tail = FALSE)

power_exact

The resulting exact power is approximately 80%, with the precise value depending on the exact implementation and numerical calculation.

Calculating Sample Size for 90% Power

Suppose the investigators decide that 90% rather than 80% power is required.

pwr.t.test(
  d = 0.50,
  sig.level = 0.05,
  power = 0.90,
  type = "two.sample",
  alternative = "two.sided"
)

The required sample size per group will increase substantially.

This illustrates an important planning tradeoff:

A
80% power: fewer patients, but a larger probability of failing to detect the planned effect.
B
90% power: more patients, but greater probability of detecting the planned effect.
C
95% power: still more patients, with diminishing efficiency relative to the additional enrollment.

One-Sided R Calculation

If a one-sided test is scientifically justified:

pwr.t.test(
  d = 0.50,
  sig.level = 0.05,
  power = 0.80,
  type = "two.sample",
  alternative = "greater"
)

The required sample size will be smaller than for the corresponding two-sided test because the rejection region is placed entirely in one tail.

Prespecification matters: The sidedness of the test, alpha level, effect size, and power should be specified before examining the primary outcome data.

Changing the Clinically Meaningful Difference

Suppose the standard deviation remains 10 units but the investigators decide that a 4-unit difference is the smallest clinically meaningful effect.

Then:

$$ d=\frac{4}{10}=0.40 $$

Because the effect is smaller, the required sample size increases.

For a 3-unit difference:

$$ d=\frac{3}{10}=0.30 $$

The required sample size increases even further.

This is one of the most important relationships in sample-size planning:

$$ \boxed{ n\propto\frac{\sigma^2}{\Delta^2} } $$

Sample Size Is Not Determined by P-Value Alone

A common mistake is to ask: How many patients do we need to obtain a significant p-value?

That is not the correct planning question.

The correct question is: How many patients are required to have adequate probability of detecting a prespecified clinically meaningful difference at a prespecified type I error?

Sample-size planning therefore incorporates both statistical and clinical considerations.

Statistical Significance vs. Clinical Significance

With a sufficiently large sample, a very small treatment difference can become statistically significant.

For example:

$$ H_0:\mu_1-\mu_2=0 $$

may be rejected for a difference of only 1 unit if the study is sufficiently large and variability is sufficiently small.

That does not automatically mean a 1-unit difference is clinically important.

Sample size should be driven by clinical relevance, not by a desire to detect arbitrary statistical significance.

What Happens If the Standard Deviation Is Underestimated?

Suppose the design assumes:

$$ \sigma=10 $$

but the actual standard deviation is 14.

Because:

$$ n\propto\sigma^2 $$

the actual variability is substantially greater than planned.

The study will consequently have less power than expected.

This is why historical or pilot estimates of variability should be examined carefully.

What Happens If the True Effect Is Smaller?

Suppose the study is powered for:

$$ \Delta=5 $$

but the actual effect is only:

$$ \Delta=3 $$

Then:

$$ d=\frac{3}{10}=0.30 $$

instead of:

$$ d=0.50 $$

The probability of obtaining statistical significance will therefore be lower than the planned 80%.

Sample Size Under Unequal Allocation: Example

Suppose investigators want a 2:1 allocation, with twice as many patients in the treatment group as in the control group.

Let:

$$ k=2 $$

Then:

$$ n_2=2n_1 $$

Using the unequal-allocation formula:

$$ n_1 = \frac{ \sigma^2 \left( z_{1-\alpha/2}+z_{1-\beta} \right)^2 \left(1+\frac{1}{2}\right) }{ \Delta^2 } $$

For the worked-example assumptions:

$$ n_1 = \frac{ 100(2.802)^2(1.5) }{ 25 } \approx47.1 $$

Thus approximately:

$$ n_1=48 $$

and:

$$ n_2=96 $$

for a total of approximately:

$$ N=144 $$

The unequal allocation therefore requires more total patients than the 1:1 allocation for the same effect, variance, alpha, and power.

Sample Size for Different Variances

Suppose the expected standard deviations are:

$$ \sigma_1=10 \qquad \sigma_2=12 $$

The planning variance becomes:

$$ \frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2} $$

The sample-size design should then be based on the actual variance structure rather than incorrectly assuming a common standard deviation.

In such settings, validated software that matches the intended Welch-type analysis is preferable to a simplified pooled-variance formula.

Covariate Adjustment and Sample Size

Some clinical trials compare treatment groups using an analysis that adjusts for baseline covariates.

For example, an ANCOVA model may analyze a follow-up continuous endpoint while adjusting for baseline measurement.

Covariate adjustment can increase statistical efficiency when the covariates explain meaningful variation in the endpoint.

However, the sample-size calculation should be aligned with the planned primary analysis.

Do not automatically assume that the simple two-sample t-test formula is the final sample-size method for an ANCOVA primary analysis. If the protocol specifies ANCOVA as the primary analysis, the sample-size assumptions should reflect that model.

Change From Baseline as a Primary Endpoint

Suppose the endpoint is change from baseline:

$$ Y_{\text{change}} = Y_{\text{post}} - Y_{\text{baseline}} $$

The standard deviation used in the sample-size calculation should correspond to the variability of the analyzed change score, not necessarily the standard deviation of the post-treatment measurement alone.

This distinction can materially affect sample size.

Repeated Measures Require Additional Consideration

If the primary analysis uses multiple measurements over time, a simple two-sample t-test may not adequately represent the planned analysis.

For example, longitudinal clinical trials may use:

  • Mixed-effects models
  • MMRM
  • Repeated-measures ANCOVA
  • Generalized estimating equations

These designs involve correlation between measurements and may obtain more information from each participant than a simple comparison at one time point.

Sample-size planning should therefore reflect the actual primary analysis whenever practical.

Common Mistakes

  1. Using the wrong effect size. The sample-size calculation should use the clinically meaningful difference, not an arbitrary difference selected to produce a convenient sample size.
  2. Using the wrong standard deviation. The assumed SD should correspond to the endpoint and analysis being planned.
  3. Confusing total N with N per group. Many formulas return the sample size per group.
  4. Forgetting attrition. The analyzable sample size may need to be inflated to obtain the required number of evaluable patients.
  5. Adding the dropout percentage directly. A 10% attrition rate requires division by 0.90, not simply multiplication by 1.10.
  6. Confusing paired and independent designs. The variance structure is different.
  7. Choosing one-sided testing solely to reduce N. The direction of the hypothesis must be scientifically justified.
  8. Assuming 80% power means 80% power for every possible effect. Power is a function of the true effect size.
  9. Ignoring unequal allocation. Changing the treatment-to-control ratio changes statistical efficiency.
  10. Using a simple t-test calculation when the primary analysis is substantially more complex. The sample-size method should correspond as closely as practical to the planned primary analysis.

A Practical Sample Size Workflow

1
Define the primary continuous endpoint.
2
Define the clinically meaningful difference \(\Delta\).
3
Obtain a defensible estimate of the standard deviation.
4
Specify the allocation ratio.
5
Specify the type I error and whether the test is one- or two-sided.
6
Specify the desired power.
7
Calculate the required analyzable sample size.
8
Inflate for expected dropout or non-evaluable observations.
9
Round sample sizes upward and verify the final operating characteristics.
10
Document all assumptions in the protocol and statistical analysis plan.

Worked Example Summary

Component Value
Design Two independent groups
Primary analysis Two-sample t-test
Clinically meaningful difference 5 units
Common standard deviation 10 units
Standardized effect \(d\) 0.50
Two-sided \(\alpha\) 0.05
Target power 80%
Allocation 1:1
Calculated N per group Approximately 63.77
Final analyzable N per group 64
Total analyzable N 128
Assumed attrition 10%
Enrollment N per group after inflation 72
Total enrollment N after inflation 144

What Should Be Reported in the Protocol?

A reproducible sample-size section should identify the assumptions used to derive the planned enrollment.

At minimum, report:

  • Primary endpoint
  • Statistical test or primary analysis model
  • Clinically meaningful treatment difference
  • Assumed standard deviation
  • Standardized effect size, when useful
  • Type I error
  • One- or two-sided testing
  • Target power
  • Allocation ratio
  • Required analyzable sample size
  • Expected dropout or non-evaluable rate
  • Final planned enrollment
  • Software or method used for the calculation

Example Protocol Language

A concise sample-size statement could be structured around the following elements:

Example: The study is designed to provide 80% power to detect a 5-unit difference between treatment groups, assuming a common standard deviation of 10 units. Using a two-sided significance level of 0.05 and equal allocation, approximately 64 evaluable patients per treatment group are required. Assuming 10% of randomized patients may be non-evaluable for the primary endpoint, the planned enrollment is 72 patients per group, for a total of 144 patients.

Why the Sample Size Calculation Should Be Reproducible

A reviewer should be able to reconstruct the sample-size calculation from the statistical documentation.

For the worked example, the essential calculation is:

$$ d=\frac{5}{10}=0.50 $$

followed by:

$$ n = \frac{ 2(1.96+0.842)^2 }{ 0.50^2 } \approx63.77 $$

and therefore:

$$ n=64\text{ per group} $$

After allowing for 10% attrition:

$$ n_{\text{enroll, per group}} = \left\lceil \frac{64}{0.90} \right\rceil = 72 $$

This sequence makes the final enrollment transparent.

The Most Important Concept

The most important idea in two-sample t-test sample-size planning is that sample size is determined by the relationship between the clinically meaningful signal and the expected variability of the endpoint.

The central quantity is:

$$ d = \frac{|\mu_1-\mu_2|}{\sigma} $$

A larger treatment difference relative to the standard deviation means a larger signal and therefore fewer patients.

A smaller treatment difference or larger standard deviation means a smaller signal-to-noise ratio and therefore more patients.

The design must then balance that effect size against:

  • Type I error
  • Desired power
  • Allocation ratio
  • Dropout and non-evaluable rates
  • Planned primary analysis
  • Clinical and operational constraints
Bottom line: For an equal-allocation two-sample t-test, a useful planning formula is $$ n = \frac{ 2\sigma^2 \left( z_{1-\alpha/2}+z_{1-\beta} \right)^2 }{ \Delta^2 } $$ per group for a two-sided test. The calculation requires a clinically justified effect size, a defensible estimate of variability, a prespecified type I error, and a target power. For the worked example of a 5-unit difference, standard deviation of 10, two-sided \(\alpha=0.05\), and 80% power, approximately 64 evaluable patients per group are required. With 10% expected attrition, the enrollment target increases to 72 per group, or 144 patients overall.

References

Cohen, J. (1988). Statistical Power Analysis for the Behavioral Sciences. 2nd ed. Lawrence Erlbaum Associates.
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. CRC Press.
Machin, D., Campbell, M.J., Tan, S.B. & Tan, S.H. (2018). Sample Size Tables for Clinical Studies. 3rd ed. Wiley-Blackwell.
Senn, S. (2007). Statistical Issues in Drug Development. 2nd ed. Wiley.
van Belle, G. (2008). Statistical Rules of Thumb. 2nd ed. Wiley.