Calculator: Two-Arm Non-Inferiority Trial (Binary Outcome)
Estimate required sample size per group for a one-sided non-inferiority test comparing two proportions with equal allocation.
How this non-inferiority sample size calculator works
This tool estimates how many participants you need in each arm of a two-group, parallel, non-inferiority trial when your endpoint is binary (success/failure). It assumes equal randomization (1:1) and a one-sided hypothesis.
In a non-inferiority design, the goal is to show that a new treatment is not unacceptably worse than control by more than a pre-specified margin. That margin is usually denoted by Δ (delta).
Statistical setup used
- Outcome: two independent proportions (treatment vs control)
- Design: parallel groups, equal sample size per arm
- Hypothesis direction: one-sided non-inferiority
- Approximation: large-sample normal (Wald-style) calculation
The implemented equation is:
Where pC is the control success rate, pT is the expected treatment success rate, and Δ is the non-inferiority margin in absolute proportion units.
Input guidance and interpretation
1) Control success rate
Use the best estimate from prior RCTs, registries, or a pilot. Overly optimistic control rates can underpower your trial.
2) Expected treatment success rate
This should reflect your best planning assumption for the experimental arm under realistic implementation conditions.
3) Non-inferiority margin (Δ)
The margin is the most important design choice and should be clinically justified, not only statistically convenient. A margin that is too wide may produce a trial that is statistically positive but clinically unconvincing.
4) Alpha and power
- One-sided alpha: often 0.025 in regulatory settings
- Power: often 0.80 or 0.90
5) Dropout inflation
The calculator reports both base sample size and dropout-adjusted sample size. The adjusted figure should usually drive your enrollment target.
Quick example
Suppose your control success rate is 70%, treatment is expected at 68%, and non-inferiority margin is 10%. With one-sided alpha of 2.5% and 80% power, the tool computes the required sample per group and then inflates for dropout.
Common mistakes in non-inferiority planning
- Choosing a non-inferiority margin without clinical and historical evidence.
- Using two-sided alpha in planning when the primary test is one-sided.
- Ignoring dropout, protocol deviations, and non-adherence.
- Planning with a single uncertain control rate and no sensitivity checks.
- Forgetting that analysis population strategy (ITT vs PP) matters more in NI trials.
Important limitations
This calculator is intended for fast protocol planning and educational use. It does not replace a full statistical analysis plan. For pivotal trials, consult a biostatistician and consider method-specific approaches (e.g., Farrington-Manning, continuity correction, unequal allocation, stratification, event-driven design, or time-to-event methods when relevant).
Practical checklist before finalizing sample size
- Document the clinical rationale for Δ.
- Run sensitivity analyses over plausible pC and pT values.
- Validate assumptions with historical data and feasibility constraints.
- Define primary and supportive analysis populations early.
- Confirm one-sided alpha and multiplicity rules with your regulatory strategy.