Sample size

Sample size calculator for non-inferiority and equivalence trials

Plan clinical trials where the goal is to show that a new treatment is not worse (or is interchangeable) compared to a reference treatment.

This tool plans non-inferiority or equivalence trials: it calculates the sample size needed to show that a new treatment is not worse than (or is interchangeable with) a reference treatment, given a clinical margin.

Calculator

Select the trial type and configure the design parameters.

Result pending…

Explanation

Non-inferiority trials aim to show that the new treatment (T) is not worse than the reference treatment (C) by more than a preset margin M. Equivalence trials (TOST, Two One-Sided Tests) require the difference to fall within ±M in both directions. In both cases, α is one-sided; the usual value is 0.025 (equivalent to a 95% confidence interval for the difference).

This type of trial contrasts with superiority trials, where the goal is to show that T is better than C. In non-inferiority, the null hypothesis is "T is worse than C by more than M," and rejecting it — by showing that the difference falls above −M — is enough to conclude non-inferiority. Choosing the margin M is the most critical clinical decision in the design: it must represent the maximum loss of efficacy that would be clinically and regulatorily acceptable.

Formulas

Non-inferiority — with assumed \(\delta = \mu_T - \mu_C\):

\( n = \left\lceil \frac{2\,\sigma^2\,(Z_\alpha + Z_\beta)^2}{(M + \delta)^2} \right\rceil \)

Equivalence (TOST) — with assumed \(\delta\):

\( n = \left\lceil \frac{2\,\sigma^2\,(Z_\alpha + Z_\beta)^2}{(M - |\delta|)^2} \right\rceil \)

  • M: non-inferiority or equivalence margin (defined clinically, always positive).
  • δ: assumed true difference (\(\mu_T - \mu_C\)); the most conservative assumption is δ = 0.
  • σ: common standard deviation of the primary outcome (taken from prior or pilot studies).
  • Zα: one-sided normal quantile. For α = 0.025 this corresponds to Z = 1.96.
  • The equivalence formula requires \(M > |\delta|\); if δ = 0, both formulas produce the same n.

Quick settings

  • M: define it clinically before the study; it reflects the maximum acceptable loss of efficacy. Regulatory guidance typically sets it between 50% and 80% of the comparator's effect versus placebo.
  • δ = 0: conservative assumption; it means T and C have exactly the same mean efficacy. If you expect T to be somewhat worse, a negative δ will increase n; if you believe T is somewhat better, a positive δ reduces it.
  • α = 0.025 one-sided: the regulatory standard (EMA/FDA) for non-inferiority trials, equivalent to a 95% CI for the difference.
  • Power: typically 0.80; 0.90 in pivotal studies or those with regulatory consequences.

Worked example

A pharmaceutical company is developing a new generic antihypertensive drug to replace the reference (branded) treatment. The primary outcome is the reduction in diastolic blood pressure in mmHg after eight weeks of treatment. Historical data for the reference drug indicate a standard deviation of σ = 10 mmHg.

The clinical committee sets the non-inferiority margin at M = 5 mmHg: a difference of less than 5 mmHg between treatments is considered clinically irrelevant and does not justify keeping the more expensive branded drug. Under the most conservative working hypothesis, both drugs are assumed to have exactly the same mean effect, i.e., δ = 0.

The design parameters follow EMA/FDA regulatory guidance for non-inferiority trials: a one-sided significance level α = 0.025 (equivalent to a 95% confidence interval for the difference) and 80% power (β = 0.20). The corresponding quantiles are \( z_{\alpha} = 1.960 \) and \( z_{\beta} = 0.842 \).

The formula for two parallel groups with equal variances is:

\( n = \dfrac{2\,\sigma^{2}\,(z_{\alpha}+z_{\beta})^{2}}{(M+\delta)^{2}} \)

Substituting the values:

\( n = \dfrac{2 \times 100 \times (1.960+0.842)^{2}}{(5-0)^{2}} = \dfrac{200 \times 7.851}{25} = \dfrac{1{,}570.2}{25} \approx 62.8 \rightarrow 63 \text{ per group} \)

Applying the standard 15% adjustment for loss to follow-up, the trial needs to recruit approximately 75 patients per group (total ≈ 150), since 63 / (1 − 0.15) = 74.1 → 75. This margin ensures that even if 15% of participants do not complete follow-up, the intention-to-treat analysis will retain the planned 80% power.

The regulatory conclusion is that if the lower bound of the 95% CI for the difference (generic − reference) is above −5 mmHg, non-inferiority will be declared and the drug can be marketed as a therapeutically equivalent alternative to the branded product.

Model assumptions

  • Normality: the outcome variable follows a normal distribution (or n is large enough to apply the CLT).
  • Equal variances: the formula assumes \(\sigma_T = \sigma_C = \sigma\). If they differ, use the quadratic mean as an approximation or more elaborate methods.
  • 1:1 parallel design: the formula gives n per group in a balanced two-group independent trial.
  • Margin defined a priori: the margin M must be set before seeing the data; changing it post hoc invalidates the analysis.
  • Known σ: in practice σ is estimated; for small samples, consider using t quantiles instead of Z (this slightly increases n).

Common uses

  • Trials of generic or biosimilar drugs versus the branded product.
  • Comparing a less toxic or more convenient treatment with the proven efficacy standard.
  • Validating alternative diagnostic or surgical procedures.
  • Pharmacokinetic bioequivalence (although PK studies typically use crossover ANOVA models with specific 80–125% limits).

How to interpret the result

The value \(n\) is the minimum size per group (1:1 balanced design) needed to demonstrate non-inferiority of the experimental treatment relative to control with the specified power and \(\alpha\) level. The total number of participants to recruit is \(2n\) plus the adjustment for dropout: divide each \(n\) by \((1 - \text{dropout rate})\). The hypothesis being tested is \(H_0\!: \mu_E - \mu_C \leq -M\) versus \(H_1\!: \mu_E - \mu_C > -M\), where \(M > 0\) is the non-inferiority margin; a significant result (\(p < \alpha\)) supports the conclusion that the experimental treatment is not worse than the control by more than \(M\) units.

Choosing the margin \(M\) is the most critical decision in the design and must be made using clinical judgment before seeing the data, not post hoc. A margin that is too wide makes the study trivially easy to pass but does not guarantee real clinical efficacy; one that is too narrow can make \(n\) impractically large. Increasing \(M\) reduces \(n\) quadratically (doubling \(M\) cuts \(n\) to a quarter); reducing \(\sigma\) also decreases it quadratically. Run a sensitivity analysis varying \(M\) by ±20% and \(\sigma\) by ±25% to see the impact on the required \(n\). 80% power is the usual minimum for this type of study; the EMA and FDA often recommend 90% power for non-inferiority trials, which increases \(n\) by approximately 30%.

Keep in mind that non-inferiority trials carry a special risk of type I error: poor study quality (high variability, poor adherence) can make an inferior treatment appear non-inferior. It is therefore essential to pre-specify the margin in the protocol, maximize study quality, and analyze both the intention-to-treat (ITT) and per-protocol (PP) populations; if both analyses agree on non-inferiority, the conclusion is more robust. Once the study is complete, build the 95% CI for the difference in means and check whether the lower bound exceeds \(-M\); use the confidence interval calculator for the difference in means for this analysis.

External references

Frequently asked questions

  • What is the difference between NI and equivalence? Non-inferiority is one-sided: it is enough to show that T is not worse by more than M (only one bound). Equivalence (TOST) is two-sided: you must show that the difference falls within ±M in both directions, which requires a larger sample when δ ≠ 0.
  • Why one-sided α = 0.025? It is the EMA/FDA regulatory standard: using α = 0.025 one-sided is equivalent to a 95% CI for the difference, ensuring the same type I error control as in a superiority trial.
  • How do I choose M? Following regulatory guidance (EMA, FDA), M is usually set as a fraction (50–80%) of the comparator's effect versus placebo. It must be determined before the study and justified both clinically and statistically in the protocol.
  • What if δ ≠ 0? If you expect the new treatment to be somewhat worse (negative δ in NI), the denominator M+δ shrinks and n increases; if you expect it to be somewhat better, n decreases. For equivalence, |δ| must be strictly less than M.
  • Is the sample size exact? It is a normal approximation; it works well for known σ or moderate sample sizes. With unknown σ or n < 30, consider adding 5–10% to account for uncertainty in σ.