happytails.ai

Equivalence test calculator

Open Equivalence test calculator 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": "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.",
      "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 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 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

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.