Ask Mallard
Study design

Sample size for a noninferiority comparison of proportions

4 min read

Plan against an unacceptable loss in outcome risk, using a prespecified margin rather than a superiority difference to detect.

NHMRC EVIDENCE LEVEL · 2009Not yet classified · InterventionProvisional design classification. Study quality and certainty of findings require separate appraisal.
Why this level?The design family and its defining features have not been specified for this hierarchy. NHMRC 2009 source

This page sizes a binary comparison without specifying its assignment mechanism or comparator design. A sample-size calculation alone cannot establish an intervention evidence level; assess the actual trial design separately.

Fit

When to use it, and when not to

Use it when

  • You compare a new and reference treatment using a binary outcome.
  • You have justified the largest acceptable loss and the direction that means worse.

Not when

Before you start

What you need

Decide these first
  1. Reference risk, pRefEnter a proportion strictly between 0 and 1.
  2. Expected new-treatment risk, pNewA blank value assumes the reference risk. Otherwise enter a proportion strictly between 0 and 1.
  3. Acceptable absolute loss, marginEnter a positive risk difference less than 1. Justify it clinically before recruitment.
  4. Direction of harm, worseIsUse higher for harms or lower for benefits. The default is higher.
  5. One-sided false-positive threshold, alphaThe default is 0.025. It is not automatically halved.
  6. Target power, powerThe default is 0.9.
  7. Allocation ratio, ratioEnter the number receiving the new treatment per reference participant; the default is equal groups.
It rests on these
  1. The margin preserves a clinically acceptable outcome.How to check: Justify the reference evidence and a stable treatment effect in the trial setting.
  2. The trial can distinguish meaningful loss.How to check: Plan adherence, follow-up and both analysis populations; blurred groups can hide inferiority.
  3. Independent binary outcomes support the unpooled normal approximation.How to check: Check sparse outcomes and confirm the final analysis matches the planning assumptions.

Plain language

How it works

The engine signs the expected risk difference so positive means worse. It subtracts this expected loss from the margin. If no positive gap remains, it returns no sample size. It adds the one-sided alpha and target-power normal quantiles. Their squared sum multiplies the unpooled risk variance, divided by the squared gap. It rounds reference size up, then rounds its ratio-scaled new-group size up.

Interpret the approximation

This is not the restricted maximum-likelihood procedure discussed by Farrington and Manning. It sizes one comparison at assumed risks. Choosing a sample-size method helps you match the planning question to the right inputs.

Planning question
Three parallel sizing questions: detection of an important effect calls for power; interval width calls for precision; event and parameter counts screen model capacity. A capacity floor establishes neither power nor adequate prediction.Match the assessment to the questionDetect an important effectEstimate with a usefulintervalScreen events andparametersPower for the planneddesignAttainable precisionHistorical capacity floorA floor is not power or adequate prediction. A fixed dataset constrains all three assessments; it does notmake them interchangeable.
Conceptual diagram. It shows the structure of the idea, not data from any study.

Worked example

A worked example

Invented for illustration
Setting
A trial compares remote and clinic follow-up using readmission.
Question
What size rules out an excess of 5 percentage points if both risks are 20%, or 20 in 100?
Approach
Set pRef=0.20, pNew=0.20, margin=0.05, worseIs=higher, alpha=0.025, power=0.90 and ratio=1.
Result
Mallard returns 1,345 reference and 1,345 new participants: 2,690 total. At that total, approximate power is 90.0%.
What it means
The count covers one analysis at the assumed risks. A second required analysis population and losses need additional planning.

In practice

Recent studies PubMed search · not vetted

Searching PubMed…

Watch out

Common mistakes

The one to remember

The margin must be justified clinically before outcomes are seen. This unpooled normal approximation sizes one analysis and includes no allowance for losses or a joint intention-to-treat and per-protocol requirement.

  • Choosing the margin to fit the available sample.Instead: Justify acceptable loss clinically before checking feasibility.
  • Using a nonsignificant superiority result to claim noninferiority.Instead: Compare the prespecified bound with the justified margin.
  • Ignoring expected loss under the new treatment.Instead: The gap between expected loss and the margin drives the calculation.

Inside Mallard

How Mallard uses this

For noninferiorityProportions, Mallard returns reference and new-group counts, their total and approximate power at a chosen total. It sizes one analysis without losses.

No Mallard code example points to this page.
Atlas node design.sample_size_noninferiority_proportions, the id a plan cue records.

Related Learn pages

Related designs and methods

Evidence

Sources & further reading

  1. Test statistics and sample size formulae for comparative binomial trials with null hypothesis of non-zero risk difference or non-unity relative risk (opens in a new tab) · Stat Med · doi 10.1002/sim.4780091208
  2. Reporting of noninferiority and equivalence randomized trials: extension of the CONSORT 2010 statement (opens in a new tab) · JAMA · doi 10.1001/jama.2012.87802
Prepared with AI assistance. PubMed titles, authors, years and DOIs checked on 2026-11-07. Record verified, confirm it supports this use. No independent professional approval is claimed. Farrington and Manning study nonzero-margin binomial tests, including restricted methods that Mallard does not implement. Piaggio and colleagues support prespecified margins and transparent reporting. Neither record turns this approximation into an exact test. Follow CONSORT and its noninferiority extension when reporting a trial, including its margin and analysis populations.
Last source review: 2026-11-07
AI-generated educational content
Mallard uses reputable methodological and reporting sources, but this material may contain errors or omit important context. Verify important methodological decisions with the cited sources and, when appropriate, a qualified research methodologist or statistician.