# Equivalence test calculator

- Human page: https://happytails.ai/en/calculators/equivalence-test-calculator/
- Markdown: https://happytails.ai/en/calculators/equivalence-test-calculator.md
- Structured JSON: https://happytails.ai/agents/en/calculators/equivalence-test-calculator/index.json
- Visibility: public

## Tool capabilities

| Property | Value |
| --- | --- |
| Tool ID | `equivalence-test-calculator` |
| Category | calculators |
| Implementation | Registered implementation. Registration alone is not a production-quality guarantee. |
| Browser execution | Use the visible action or interactive controls. |
| Browser processing | Browser; see tool notes for network behavior. |
| HTTP API | Not callable through HTTP. |
| Browser-agent interface | run_current_tool |

### Implementation notes

Runs on your device. Margins must be chosen before seeing the data; the decision uses the 1 - 2 alpha confidence interval. With raw two-group CSV the difference is the first group listed minus the second.

### Inputs and settings

No free-text input is required. Use the file inputs and/or settings below.

| Setting | Meaning | Control type | Default | Constraints |
| --- | --- | --- | --- | --- |
| `design` | Design | select | "two-sample" | Allowed: two-sample, paired, one-sample, two-proportions |
| `data` | Data | select | "summary" | Allowed: summary, raw |
| `lowerMargin` | Lower equivalence margin | text | "-1.5" |  |
| `upperMargin` | Upper equivalence margin | text | "1.5" |  |
| `alpha` | Alpha for each one-sided test | text | "0.05" |  |
| `n1` | Group 1 size | text | "20" |  |
| `mean1` | Group 1 mean | text | "10.2" |  |
| `sd1` | Group 1 standard deviation | text | "2" |  |
| `n2` | Group 2 size | text | "22" |  |
| `mean2` | Group 2 mean | text | "9.8" |  |
| `sd2` | Group 2 standard deviation | text | "2.5" |  |
| `n` | Sample size or number of pairs | text | "15" |  |
| `mean` | Mean (of the differences when paired) | text | "0.3" |  |
| `sd` | Standard deviation (of the differences when paired) | text | "1.1" |  |
| `x1` | Group 1 successes | text | "14" |  |
| `x2` | Group 2 successes | text | "15" |  |
| `mu` | Reference value (one sample) | text | "0" |  |
| `equalVariances` | Assume equal variances (Student) | checkbox | false |  |
| `csv` | Raw CSV | textarea | "group,value\nA,10.1\nA,9.6\nA,11.2\nB,9.9\nB,10.4\nB,9.1" |  |

### Browser-agent workflow

1. Open the human page in a browser that supports WebMCP.
2. Discover the interface exposed by that page; use its actual schema.
3. Select files on the page first when the tool requires files.
4. Call `run_current_tool` with valid input and settings.
5. Inspect the returned result or error and the displayed output. Retrieve files from the displayed download links.

Calls do not automatically copy or download results. Browser permissions still apply. Interface availability alone is not proof of successful execution.

### Planning specification

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, alpha is from 0.0001 to 0.4999 and the lower margin must be below the upper margin. Raw CSV uses the exact headers group,value or before,after or value, with no blank cells, up to 10,000 rows and 1,000,000 characters; it is not available for two proportions. Downloads: a JSON report and a CSV result row.

This describes intended requirements. Use the implementation notes, interface schema and observed output to determine current support.

### Complete machine-readable capability record

```json
{
  "id": "equivalence-test-calculator",
  "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, alpha is from 0.0001 to 0.4999 and the lower margin must be below the upper margin. Raw CSV uses the exact headers group,value or before,after or value, with no blank cells, up to 10,000 rows and 1,000,000 characters; it is not available for two proportions. Downloads: a JSON report and a CSV result row.",
  "implementation": {
    "fields": [
      {
        "key": "design",
        "label": "Design",
        "value": "two-sample",
        "type": "select",
        "values": [
          "two-sample",
          "paired",
          "one-sample",
          "two-proportions"
        ],
        "labels": {
          "two-sample": "Two independent groups",
          "paired": "Paired measurements",
          "one-sample": "One sample against a reference value",
          "two-proportions": "Two proportions"
        }
      },
      {
        "key": "data",
        "label": "Data",
        "value": "summary",
        "type": "select",
        "values": [
          "summary",
          "raw"
        ],
        "labels": {
          "summary": "Summary statistics",
          "raw": "Raw CSV values"
        }
      },
      {
        "key": "lowerMargin",
        "label": "Lower equivalence margin",
        "value": "-1.5",
        "type": "text",
        "maxLength": 40,
        "help": "In the units of the difference, chosen before seeing the data. Must be below the upper margin."
      },
      {
        "key": "upperMargin",
        "label": "Upper equivalence margin",
        "value": "1.5",
        "type": "text",
        "maxLength": 40,
        "help": "In the units of the difference. For proportions use a proportion, for example 0.1."
      },
      {
        "key": "alpha",
        "label": "Alpha for each one-sided test",
        "value": "0.05",
        "type": "text",
        "maxLength": 40,
        "help": "From 0.0001 to 0.4999. Alpha 0.05 gives a 90 percent interval."
      },
      {
        "key": "n1",
        "label": "Group 1 size",
        "value": "20",
        "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": "Group 1 mean",
        "value": "10.2",
        "type": "text",
        "maxLength": 40,
        "help": "Use a decimal point and no thousands separators.",
        "showWhen": {
          "design": [
            "two-sample"
          ],
          "data": [
            "summary"
          ]
        }
      },
      {
        "key": "sd1",
        "label": "Group 1 standard deviation",
        "value": "2",
        "type": "text",
        "maxLength": 40,
        "help": "Sample SD with n - 1, greater than zero.",
        "showWhen": {
          "design": [
            "two-sample"
          ],
          "data": [
            "summary"
          ]
        }
      },
      {
        "key": "n2",
        "label": "Group 2 size",
        "value": "22",
        "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": "Group 2 mean",
        "value": "9.8",
        "type": "text",
        "maxLength": 40,
        "help": "Use a decimal point and no thousands separators.",
        "showWhen": {
          "design": [
            "two-sample"
          ],
          "data": [
            "summary"
          ]
        }
      },
      {
        "key": "sd2",
        "label": "Group 2 standard deviation",
        "value": "2.5",
        "type": "text",
        "maxLength": 40,
        "help": "Sample SD with n - 1, greater than zero.",
        "showWhen": {
          "design": [
            "two-sample"
          ],
          "data": [
            "summary"
          ]
        }
      },
      {
        "key": "n",
        "label": "Sample size or number of pairs",
        "value": "15",
        "type": "text",
        "maxLength": 40,
        "help": "Whole number of at least 2.",
        "showWhen": {
          "design": [
            "paired",
            "one-sample"
          ],
          "data": [
            "summary"
          ]
        }
      },
      {
        "key": "mean",
        "label": "Mean (of the differences when paired)",
        "value": "0.3",
        "type": "text",
        "maxLength": 40,
        "help": "Use a decimal point and no thousands separators.",
        "showWhen": {
          "design": [
            "paired",
            "one-sample"
          ],
          "data": [
            "summary"
          ]
        }
      },
      {
        "key": "sd",
        "label": "Standard deviation (of the differences when paired)",
        "value": "1.1",
        "type": "text",
        "maxLength": 40,
        "help": "Greater than zero.",
        "showWhen": {
          "design": [
            "paired",
            "one-sample"
          ],
          "data": [
            "summary"
          ]
        }
      },
      {
        "key": "x1",
        "label": "Group 1 successes",
        "value": "14",
        "type": "text",
        "maxLength": 40,
        "help": "Whole number from 0 to the group size.",
        "showWhen": {
          "design": [
            "two-proportions"
          ],
          "data": [
            "summary"
          ]
        }
      },
      {
        "key": "x2",
        "label": "Group 2 successes",
        "value": "15",
        "type": "text",
        "maxLength": 40,
        "help": "Whole number from 0 to the group size.",
        "showWhen": {
          "design": [
            "two-proportions"
          ],
          "data": [
            "summary"
          ]
        }
      },
      {
        "key": "mu",
        "label": "Reference value (one sample)",
        "value": "0",
        "type": "text",
        "maxLength": 40,
        "help": "The margins are applied to the mean minus this value.",
        "showWhen": {
          "design": [
            "one-sample"
          ]
        }
      },
      {
        "key": "equalVariances",
        "label": "Assume equal variances (Student)",
        "value": false,
        "type": "checkbox",
        "showWhen": {
          "design": [
            "two-sample"
          ]
        }
      },
      {
        "key": "csv",
        "label": "Raw CSV",
        "value": "group,value\nA,10.1\nA,9.6\nA,11.2\nB,9.9\nB,10.4\nB,9.1",
        "type": "textarea",
        "maxLength": 1000000,
        "help": "Headers group,value for two groups (the difference is the first group listed minus the second); before,after for paired data (before minus after); value for one sample. No blank cells. Not available for two proportions. Up to 10,000 rows and 1,000,000 characters.",
        "showWhen": {
          "data": [
            "raw"
          ]
        }
      }
    ],
    "registrationFamily": "statistical-analysis-reference",
    "input": false,
    "note": "Runs on your device. Margins must be chosen before seeing the data; the decision uses the 1 - 2 alpha confidence interval. With raw two-group CSV the difference is the first group listed minus the second.",
    "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.",
      "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 difference lies inside equivalence margins you set in advance, using two one-sided tests (TOST). Works with two groups, paired or one-sample data, or two proportions.

How can we improve this tool?

Report a problem or share an idea.

Please leave out private information. Your message and the tool name go to our team via PostHog.

### How to use Equivalence test calculator

1. Choose the design and whether you have summary statistics or raw CSV values.
2. Enter the lower and upper margins you fixed before seeing the data, and alpha.
3. Enter the summaries, or paste the CSV.
4. Calculate, compare the 1 - 2 alpha interval with the margins, and download the report.

## Useful next steps

- [Confidence interval calculator](https://happytails.ai/en/calculators/confidence-interval-calculator/) ([Markdown](https://happytails.ai/en/calculators/confidence-interval-calculator.md))

- [Sample size calculator](https://happytails.ai/en/calculators/sample-size-calculator/) ([Markdown](https://happytails.ai/en/calculators/sample-size-calculator.md))

- [Pooled summary statistics](https://happytails.ai/en/calculators/pooled-summary-statistics/) ([Markdown](https://happytails.ai/en/calculators/pooled-summary-statistics.md))

## How TOST works

Two one-sided tests check that the difference is above the lower margin and below the upper margin (Schuirmann 1987, J Pharmacokinet Biopharm 15:657; Lakens 2017, Social Psychological and Personality Science 8:355). The TOST p-value is the larger of the two one-sided p-values. Equivalence is declared when it is below alpha, which is the same as the 1 - 2 alpha confidence interval lying inside the margins, so alpha 0.05 uses a 90 percent interval.

### Designs

Two groups use Welch's t by default, or Student's t if you assume equal variances. The difference is group 1 minus group 2; with raw CSV, group 1 is the first group label listed and the report names both groups, so set asymmetric margins with that order in mind. Paired data use the mean and SD of the differences, before minus after for raw CSV. One sample compares the mean minus a reference value with the margins. Two proportions use the difference with an unpooled Wald standard error, which needs reasonably large groups.

### Limits

Margins must be justified and fixed before the data are seen. A nonsignificant ordinary test does not show equivalence, and a failed TOST does not show a difference.
