Bell Statistics

What is a non-inferiority test?

A non-inferiority test asks whether a new option is no worse than the current one by more than a margin decided in advance. It is the right test when the change is worth making for some other reason and the only question is whether performance holds up.

Also called
non-inferiority trial, no worse than test, one-sided equivalence test
Allon Korem

Written by Allon Korem

Chief Executive Officer

Last updated

In plain English

Not every change is meant to improve the metric. Migrating to a cheaper vendor, simplifying a page, retiring a legacy service, replacing a heavy model with a faster one — in each case the benefit lives somewhere other than the primary metric, and the only question is whether that metric holds up. An ordinary A/B test is the wrong instrument for this. It asks whether the variant is better, and answers "we could not tell" when the two are similar, which is precisely the answer you were hoping for and cannot act on.

The problem is that failing to find a difference is not evidence there is none. A test with 200 users will fail to detect almost anything, and reading its non-significant result as "performance held up" rewards underpowered experiments — the less data you collect, the more likely you are to conclude the new version is fine. That inversion is the specific trap non-inferiority testing exists to close.

It closes it by making you commit to a margin first. You state, before the test runs, the largest drop you would tolerate — one percentage point of conversion, say, or 2% of revenue — and the test asks whether you can rule out a loss larger than that. The evidence has to establish the absence of a meaningful decline, which is a claim that gets harder with less data rather than easier. The verdict comes from a confidence interval: if its lower bound sits above minus the margin, the new version is non-inferior.

Choosing the margin is the whole exercise and it is a business decision wearing statistical clothing. Too generous and you have licensed a real loss: a 3% margin on revenue means shipping something that might genuinely cost 3%. Too tight and the test becomes unaffordable, since the required sample grows roughly with the square of the margin — halving it quadruples the traffic you need. The honest process is to work out what the change is worth on the other side of the ledger and set the margin below it, then write the number down before any data arrives.

It is deliberately one-sided, and this is the one context where that is not a red flag. The question genuinely has a direction: you want to rule out a meaningful loss and you do not care about detecting a gain, because a gain is welcome and needs no defence. That is different from the one-tailed test applied to an ordinary comparison, where blinding yourself to harm is exactly the wrong trade. Its close relative is the equivalence test, which bounds the difference in both directions.

The formula

The arithmetic is an ordinary comparison shifted by the margin. What changes is the hypothesis being tested, not the machinery testing it.

The hypotheses
H₀: μ_new − μ_old ≤ −Δ H₁: μ_new − μ_old > −Δ

The null is that the new version IS meaningfully worse. Rejecting it is what licenses the claim — the reverse of an ordinary test.

The test statistic
t = ( ( x̄_new − x̄_old ) + Δ ) / SE

The observed difference shifted by the margin. Everything else is a standard t-test.

The decision rule
non-inferior ⟺ lower bound of the 95% CI > −Δ

Usually read straight off the interval — see the non-inferiority calculator.

Sample size
n ∝ ( z_α + z_β )² σ² / Δ²

Quadratic in the margin: halving Δ quadruples n. This is why the margin is the expensive decision.

Worked example

A team wants to replace a third-party recommendation engine with an in-house model, saving £340,000 a year. The concern is add-to-cart rate, currently 8.4%. They agree in advance that a drop of more than 0.4 percentage points would wipe out the saving, so that becomes the margin. The test runs on 95,000 users per arm.

Margin (Δ)
0.4 percentage points
Incumbent
8.42% add-to-cart
In-house model
8.29% add-to-cart
Observed difference
−0.13 pp
95% CI on the difference
−0.38 pp to +0.12 pp
Lower bound vs −Δ
−0.38 > −0.40

Non-inferiority is established, but only just: the lower bound clears the margin by two hundredths of a percentage point.

This passes and it should not be reported as a comfortable result. The in-house model is very likely slightly worse — the point estimate is −0.13 pp and the interval sits mostly below zero — and what the test establishes is that the loss is probably not big enough to matter at the margin the team chose. Read the interval, not the verdict: a true effect at the −0.38 end would cost roughly £320,000 a year in lost carts against a £340,000 saving, which is a much less attractive trade than "non-inferiority established" implies. With this little headroom the right response is more traffic before committing, not a green tick. Note also how completely the margin drove the outcome — at 0.3 pp this test fails, at 0.5 pp it passes comfortably, and none of the data changed.

Common misconceptions

A non-significant A/B test shows the two versions perform the same.
It shows you did not detect a difference, which is a statement about the test rather than the world. An underpowered experiment reliably produces non-significant results whether or not an effect exists — so treating this as evidence of sameness rewards collecting less data. Establishing similarity requires a margin and a test built around it.
The margin is a statistical parameter, so a statistician should pick it.
It is a business decision expressed in statistical notation: the largest loss you are willing to accept in exchange for whatever the change buys elsewhere. A statistician can tell you what a given margin costs in sample size; only the business can say what a 0.4-point drop in conversion is worth against a £340,000 saving.
Passing a non-inferiority test means the new version is as good as the old one.
It means you have ruled out its being worse by more than the margin. A result can pass while the point estimate is negative and the most likely truth is a small real loss — which is often an acceptable trade, but it is a different claim from equivalence. If you need to bound the difference in both directions, that is an equivalence test.

Frequently asked questions

How do I choose the non-inferiority margin?
Start from what the change is worth on the other side. If migrating saves £340,000 a year, work out what drop in the primary metric would consume that saving and set the margin below it, leaving room for the fact that a passing result often means a small real loss. Then check the sample size it implies — the requirement scales with the square of the margin, so a tight one can be unaffordable and that trade-off is worth seeing before the test starts, not after.
Why is a one-sided test acceptable here when it usually is not?
Because the question genuinely has a direction. You are trying to rule out a meaningful loss; a gain requires no defence and needs no detection. That is different from an ordinary A/B comparison, where choosing one-sided means building an instrument that cannot see harm — the outcome you most need to know about. Here the harmful direction is the one being tested, which is the reverse situation.
What does it mean when a non-inferiority test fails?
Only that you could not rule out a loss larger than the margin — not that such a loss exists. There are two quite different causes: the new version really is meaningfully worse, or the test lacked the precision to establish otherwise. Look at the confidence interval to tell them apart. An interval centred near zero but too wide is an underpowered test; one sitting clearly below the margin is a genuine regression.

Related terms

  • Confidence interval

    The range your data can actually support, and why it answers the business question a p-value cannot.

  • Equivalence test

    The only test that can conclude "these are the same" — done as two one-sided tests against a band you set first.

  • Minimum detectable effect

    The smallest lift you designed to catch — a business decision that gets outsourced to statistics.

  • One-tailed vs two-tailed test

    The choice that halves your p-value and costs you the ability to see damage — and why it must be made before the data arrives.

Calculate it

Knowing the term is the easy part

Applying it to a live measurement problem is the part that goes wrong. If you are designing an experiment, reading a result you do not trust, or trying to work out what your marketing actually caused, that is the work we do.