Skip to content

Not worse by much: Farrington–Manning for proportions

To claim a new option isn't meaningfully worse, set a margin, test against it, and use a standard error worked out at that margin.

Advanced ~12 min10 steps

What runs in CodeSplash

You will be able to

  • State non-inferiority hypotheses for two proportions
  • Explain why Farrington–Manning doesn't pool the groups
  • Read non-inferiority and equivalence from an interval and a margin

Read first

01

A different burden of proof

Read

A cheaper test kit doesn't have to beat the old one. It has to be no worse than the old one by more than a marginNon-inferiority marginThe largest loss you would accept and still call the new variant "not worse"; the test rejects H₀ (worse by the margin or more). δ\delta.

That reverses the burden of proof. The null hypothesis says the new option is worse by at least the margin:

H0 ⁣:  p1−p2≤−δH1 ⁣:  p1−p2>−δH_0\colon\; p_1 - p_2 \le -\delta \qquad H_1\colon\; p_1 - p_2 > -\delta

A non-inferiorityNon-inferiority testAsks whether a new option is no worse than the standard by more than a margin chosen in advance, rather than whether they differ. claim needs evidence against that null.

02

Predict the p-value

Predict

Predict first

Treatment has 18 of 30 successes, and control has 9 of 30. The ordinary z test gives p = .020. With a margin of 0.1, how will the one-sided non-inferiority p-value compare?

Smaller than the ordinary test's p-valueLarger than the ordinary test's p-valueThe same as the ordinary test's p-value
Reveal

Smaller: p < .001. The difference is now measured from −0.1, not from 0, and only one direction counts. It's an easier claim to support, so the margin matters a lot.

03

The right standard error

Read

Under this null, the two proportions differ by δ\delta, so pooling them as if they were equal would be wrong. Farrington–ManningFarrington–Manning testScore test that two proportions differ by a stated amount or ratio, with variance estimated at that null; used for non-inferiority. estimates both by maximum likelihood, subject to that difference:

z=p^1−p^2+δp~1(1−p~1)/n1+p~2(1−p~2)/n2z = \frac{\hat p_1 - \hat p_2 + \delta}{\sqrt{\tilde p_1 (1 - \tilde p_1)/n_1 + \tilde p_2 (1 - \tilde p_2)/n_2}}

Here the constrained estimates are p~1≈0.404\tilde p_1 \approx 0.404 and p~2≈0.504\tilde p_2 \approx 0.504, so the standard error is about 0.1280.128, and z≈(0.6−0.3+0.1)/0.128z \approx (0.6 - 0.3 + 0.1) / 0.128. The card gives z = 3.13.

04

Move the margin

Explore

This explorable works on means, and the logic carries over. Narrow the margin, and watch the interval's relationship to it change. Non-inferiority needs only the lower limit above −δ-\delta. Equivalence needs the whole interval inside ±δ\pm\delta.

BExplorable · Two one-sided tests

How do you show that two things are the same, not merely that you found no difference?

What can you conclude here?

How sure?
0.10
1.00
50
0.40
−margin+margin0

Inconclusive: neither test rejects

Equivalent when the whole 90% interval sits inside the margins. TOST p = .068; ordinary test p = .618.

Commit your prediction above to see the result

Make your prediction first; the figure appears when you commit.

Make your prediction to see the result.

Here the difference's 95% interval has a lower limit of 0.049, well above −0.1.

05

Choose the margin first

Reflect

δ\delta is a judgment, not a statistical output. Ask how much worse you'd accept in return for what the new option offers, such as a lower cost or fewer side effects. Trials often set it as a fraction of the established treatment's known benefit.

Fix it before you see the data, and write down why. A margin chosen afterwards can make any result look non-inferior.

For a product you know, what's the largest loss you'd accept, and who would have to agree with you?

06

When lower is better

Read

If the event is bad, such as a rejection or an infection, set Better outcome is to lower. The test then looks at the upper side.

For Berkeley's rejections, men's 55.5% against women's 69.6% with a margin of 0.05 gives p < .001. Berkeley isn't a real non-inferiority question; it only shows the option at work.

07

Equivalence, on a ratio scale

Read

Equivalence asks that the effect be inside two bounds, so both one-sided tests must pass. On the risk-ratio scale, a margin of 0.8 means bounds of 0.80 and 1.25.

Berkeley's admission ratio is 1.47 (95% CI 1.35 to 1.59), entirely above the upper bound. Equivalence isn't shown, despite the 4,526 applicants. A large sample can show that an effect is inside the bounds only if it really is.

08

Check your understanding

Checkpoint

Check yourself

The difference between a new and an old option is −0.04, the margin is 0.10, and the standard error at the margin is 0.025. What is z?

Show the answer

Answer: 2.4

(−0.04 + 0.10) / 0.025 = 2.4. The new option is observed to be slightly worse, yet the data can still support non-inferiority.

Check yourself

The 95% interval for the difference (new minus old) runs from −0.08 to 0.02, and the margin is 0.10. What can you claim?

Show the answer

Answer: a

The lower limit is above −0.10, so non-inferiority holds. Zero is inside the interval, so superiority isn't shown. Containing zero doesn't count against a non-inferiority claim.

Check yourself

An ordinary difference test gives p = 0.30, with no margin set. Which conclusion is right?

Show the answer

Answer: c

A large p-value doesn't show that a difference is small. Without a margin, there's nothing to be non-inferior to.

Check yourself

A risk-ratio equivalence margin of 0.8 has a matching upper bound of 1/0.81 / 0.8. What is it?

Show the answer

Answer: 1.25

1 / 0.8 = 1.25. Ratios are symmetric on the log scale, so the bounds are reciprocals of each other.

09

Do it in CodeSplash

In the app

Choose Groups, Outcome and Event level as usual, then set Hypothesis to Non-inferiority or Equivalence. Margin on the chooses Risk difference or Risk ratio, which brings up Margin (difference) or Margin (ratio). Better outcome is sets the direction.

Python
import numpy as np
from scipy import optimize, stats

def fm_z(x1, n1, x2, n2, delta):
    """Farrington-Manning z for H0: p1 - p2 = delta."""
    def nll(p2):
        return -(stats.binom.logpmf(x1, n1, p2 + delta) + stats.binom.logpmf(x2, n2, p2))
    bounds = (max(0, -delta) + 1e-9, min(1, 1 - delta) - 1e-9)
    p2 = optimize.minimize_scalar(nll, bounds=bounds, method="bounded").x
    p1 = p2 + delta
    return (x1 / n1 - x2 / n2 - delta) / np.sqrt(p1 * (1 - p1) / n1 + p2 * (1 - p2) / n2)

z = fm_z(18, 30, 9, 30, delta=-0.10)
print(z, stats.norm.sf(z))
R
fm_z <- function(x1, n1, x2, n2, delta) {
  nll <- function(p2) -(dbinom(x1, n1, p2 + delta, log = TRUE) + dbinom(x2, n2, p2, log = TRUE))
  p2 <- optimize(nll, c(max(0, -delta), min(1, 1 - delta)), tol = 1e-8)$minimum
  p1 <- p2 + delta
  (x1 / n1 - x2 / n2 - delta) / sqrt(p1 * (1 - p1) / n1 + p2 * (1 - p2) / n2)
}

z <- fm_z(18, 30, 9, 30, delta = -0.10)
c(z = z, p = pnorm(z, lower.tail = FALSE))
10

Recap

Recap
  • Non-inferiority tests against a margin, so the burden of proof falls on showing "not much worse".
  • Farrington–Manning works out its standard error at the margin, not by pooling.
  • The margin carries the claim. Set it before the data, and justify it in words.

Concepts in this lesson