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.
Runs locally in your browser; nothing is uploaded. Group sizes are whole numbers of at least 2 (at least 1 for proportions), SDs are greater than zero, the margin is greater than zero (below 1 for proportions), alpha is from 0.0001 to 0.4999 and power from 0.5001 to 0.9999, and the expected difference for planning lies on the better side of the margin. Setting numbers are plain decimals with a digit before the point, such as 0.95, without exponents. Raw CSV is for means only, in long format with two groups, up to 10,000 rows and 1,000,000 characters; a blank line between rows is rejected and blank lines after the last row are ignored. Downloads: a JSON report, CSV result and plan rows and an SVG chart of the bound against the margin. Use the fields for summaries, or choose Raw CSV values to paste data. Up to 1,000,000 characters. Review the settings before running.
Your result
How to use Noninferiority test planner
- Choose means or proportions and whether you have summaries or raw CSV values.
- Enter the margin you fixed before seeing the data, the direction, alpha and planning power.
- Enter the group summaries, or paste the CSV.
- 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.