happytails.ai

Noninferiority test planner

Test whether a new option is not worse than a control by more than a margin you fixed in advance, using a one-sided confidence bound for a difference in means or proportions, and plan the sample size per group.

Your result

Report a problem or share an idea.

How to use Noninferiority test planner
  1. Choose means or proportions and whether you have summaries or raw CSV values.
  2. Enter the margin you fixed before seeing the data, the direction, alpha and planning power.
  3. Enter the group summaries, or paste the CSV.
  4. Run the test, compare the confidence bound with the margin, and download the report and plan.

Useful next steps

How the test works

The difference is treatment minus control. When higher values are better, the null hypothesis is that the difference is at most minus the margin, and non-inferiority is shown when the one-sided 1 - alpha lower confidence bound lies above it; when lower is better the upper bound must lie below the margin. Means use Welch's t, and proportions use an unpooled Wald z, which needs reasonably large groups. A one-sided alpha of 0.025 matches a two-sided 95 percent interval.

Sample size plan

The plan uses the normal-approximation formulas of Chow, Shao and Wang (2008, Sample Size Calculations in Clinical Research, 2nd ed., sections 3.2 and 4.2) for the chosen alpha, power, margin and expected difference. Means use the planning SD or the pooled SD of the data; proportions use the planning control proportion or the observed one. The expected difference must lie on the better side of the margin (above minus the margin when higher is better, below the margin when lower is better), or no sample size can show non-inferiority. Results are rounded up per group.

Limits

The margin must be justified and fixed before the data are seen, and justifying it is your responsibility; this tool makes no regulatory claim. A nonsignificant result does not show non-inferiority, and a non-inferiority result does not show that the new option is better.