Noninferiority test planner
Open Noninferiority test planner on Happytails.ai. This view has the same page content and links, with explicit tool capabilities. Read the processing notes before using a tool.
Tool capabilities
{
"id": "noninferiority-test-planner",
"category": "calculators",
"built": true,
"requirements": "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.",
"implementation": {
"fields": [
{
"key": "design",
"label": "Outcome",
"value": "two-sample",
"type": "select",
"values": [
"two-sample",
"two-proportions"
],
"labels": {
"two-sample": "Means of two independent groups",
"two-proportions": "Proportions in two groups"
}
},
{
"key": "data",
"label": "Data",
"value": "summary",
"type": "select",
"values": [
"summary",
"raw"
],
"labels": {
"summary": "Summary statistics",
"raw": "Raw CSV values (means only)"
}
},
{
"key": "margin",
"label": "Non-inferiority margin",
"value": "1",
"type": "text",
"maxLength": 40,
"help": "Greater than zero, in the units of the difference (a proportion below 1 for proportions). Fix it before seeing the data."
},
{
"key": "direction",
"label": "Direction",
"value": "higher-is-better",
"type": "select",
"values": [
"higher-is-better",
"lower-is-better"
],
"labels": {
"higher-is-better": "Higher values are better",
"lower-is-better": "Lower values are better"
}
},
{
"key": "alpha",
"label": "One-sided alpha",
"value": "0.025",
"type": "text",
"maxLength": 40,
"help": "From 0.0001 to 0.4999. One-sided 0.025 matches a two-sided 95 percent interval."
},
{
"key": "power",
"label": "Planning power",
"value": "0.8",
"type": "text",
"maxLength": 40,
"help": "From 0.5001 to 0.9999."
},
{
"key": "expectedDifference",
"label": "Expected true difference for planning",
"value": "0",
"type": "text",
"maxLength": 40,
"help": "Treatment minus control assumed when planning, for example 0."
},
{
"key": "planningSd",
"label": "Planning standard deviation (optional)",
"value": "",
"type": "text",
"maxLength": 40,
"help": "Leave blank to use the pooled SD of the data.",
"showWhen": {
"design": [
"two-sample"
]
}
},
{
"key": "planningProportion",
"label": "Planning control proportion (optional)",
"value": "",
"type": "text",
"maxLength": 40,
"help": "Between 0 and 1. Leave blank to use the observed control proportion.",
"showWhen": {
"design": [
"two-proportions"
]
}
},
{
"key": "n1",
"label": "Treatment group size",
"value": "120",
"type": "text",
"maxLength": 40,
"help": "Whole number of at least 2 (at least 1 for proportions).",
"showWhen": {
"design": [
"two-sample",
"two-proportions"
],
"data": [
"summary"
]
}
},
{
"key": "mean1",
"label": "Treatment group mean",
"value": "7.6",
"type": "text",
"maxLength": 40,
"help": "Use a decimal point and no thousands separators.",
"showWhen": {
"design": [
"two-sample"
],
"data": [
"summary"
]
}
},
{
"key": "sd1",
"label": "Treatment group standard deviation",
"value": "1.4",
"type": "text",
"maxLength": 40,
"help": "Sample SD with n - 1, greater than zero.",
"showWhen": {
"design": [
"two-sample"
],
"data": [
"summary"
]
}
},
{
"key": "n2",
"label": "Control group size",
"value": "120",
"type": "text",
"maxLength": 40,
"help": "Whole number of at least 2 (at least 1 for proportions).",
"showWhen": {
"design": [
"two-sample",
"two-proportions"
],
"data": [
"summary"
]
}
},
{
"key": "mean2",
"label": "Control group mean",
"value": "7.8",
"type": "text",
"maxLength": 40,
"help": "Use a decimal point and no thousands separators.",
"showWhen": {
"design": [
"two-sample"
],
"data": [
"summary"
]
}
},
{
"key": "sd2",
"label": "Control group standard deviation",
"value": "1.5",
"type": "text",
"maxLength": 40,
"help": "Sample SD with n - 1, greater than zero.",
"showWhen": {
"design": [
"two-sample"
],
"data": [
"summary"
]
}
},
{
"key": "x1",
"label": "Treatment group successes",
"value": "88",
"type": "text",
"maxLength": 40,
"help": "Whole number from 0 to the group size.",
"showWhen": {
"design": [
"two-proportions"
]
}
},
{
"key": "x2",
"label": "Control group successes",
"value": "90",
"type": "text",
"maxLength": 40,
"help": "Whole number from 0 to the group size.",
"showWhen": {
"design": [
"two-proportions"
]
}
},
{
"key": "groupColumn",
"label": "Group column",
"value": "group",
"type": "text",
"maxLength": 200,
"help": "Exact header. The first group to appear is the treatment group.",
"showWhen": {
"data": [
"raw"
]
}
},
{
"key": "valueColumn",
"label": "Value column",
"value": "value",
"type": "text",
"maxLength": 200,
"help": "Exact header of the numeric outcome column.",
"showWhen": {
"data": [
"raw"
]
}
},
{
"key": "missing",
"label": "Blank cells",
"value": "reject",
"type": "select",
"values": [
"reject",
"drop"
],
"labels": {
"reject": "Stop and show an error",
"drop": "Drop incomplete rows"
},
"showWhen": {
"data": [
"raw"
]
}
},
{
"key": "csv",
"label": "Raw CSV",
"value": "group,value\nnew,7.9\nnew,6.8\nnew,8.4\ncurrent,7.5\ncurrent,8.1\ncurrent,7.2",
"type": "textarea",
"maxLength": 1000000,
"help": "Two groups in long format, up to 10,000 rows and 1,000,000 characters.",
"showWhen": {
"data": [
"raw"
]
}
}
],
"registrationFamily": "statistical-comparison-tests",
"input": false,
"note": "Runs on your device. Fix the margin before seeing the data; a nonsignificant result does not show non-inferiority.",
"experience": {
"automatic": false,
"single": false,
"inputMaxLength": 1000000,
"inputMode": "text",
"label": "Summary statistics",
"placeholder": "Enter values in the form fields",
"help": "Use the fields for summaries, or choose Raw CSV values to paste data. Up to 1,000,000 characters. Review the settings before running.",
"helpParts": [
"Use the fields for summaries, or choose Raw CSV values to paste data.",
"Up to 1,000,000 characters.",
"Review the settings before running."
],
"action": null
},
"mode": "explicit",
"interactive": false
},
"execution": "Browser interface",
"api": null,
"browser_agent": {
"supported": true,
"name": "run_current_tool",
"discovery": "WebMCP on the human page in a supporting browser",
"verification": "See audit/API-AUDIT.md; availability is not verification"
}
}Page guide
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.
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.