Bell Statistics

Equivalence test calculator: two means

A non-significant [two-sample t-test](/calculators/two-sample-t-test) does not tell you two averages are the same — only that you could not distinguish them. This calculator runs the test that does answer the question: two one-sided tests against a margin you nominate in advance, and the sample size that design actually needs.

Allon Korem

Written by Allon Korem

Chief Executive Officer

Last updated

Calculator

A magnitude. The test uses ±this.

Group 1 − group 2. 0 assumes exact parity.

Pooled, from historical data.

n₂ ÷ n₁. 1 is an even split.

Each one-sided test runs at α.

Required sample size for equivalence
Per group975
Group 2975
Total1,950
Achieved powerAt the whole-number sample above.90.0%
Margin as Cohen's dΔ ÷ σ.0.167
Assumed true difference0.2000

Collect 1,950 observations in total and both one-sided tests will reject 90.0% of the time — that is, the study will succeed in showing the two means differ by less than 1.00 — provided the real gap is about the 0.200 you assumed. What buys that power is the room between the assumed gap and the margin, not the margin on its own: nudge the assumed difference towards ±1.00 and the sample climbs steeply.

Sample size per group against statistical powerReaching 0.0% power takes 2 per group and 99.4% takes 1,938; the 90.0% target is met at 975.2004006008001,0001,2001,4001,6001,8000%25%50%75%100%PowerSample size — per group90.0% → 975

Drag the dashed line — or focus it and use the arrow keys — to change the target power and resize the study.

Show these numbers as a table
Power at each sample size per group
PowerSample size
0.0%2
0.0%162
33.1%322
59.2%482
74.5%642
83.8%802
89.6%962
93.4%1,122
95.8%1,282
97.3%1,442
98.3%1,602
99.0%1,762
99.4%1,922
Required sample per group against equivalence marginDetecting 0.300 takes 61,661 and 4.80 takes 35. At the 1.00 currently entered it is 975 — the requirement falls roughly as the square of the effect.1001,00010,0001.002.003.004.00Equivalence marginRequired sample per group (log scale)1.00 → 975

Drag the dashed line — or focus it and use the arrow keys — to change equivalence margin.

Show these numbers as a table
Required sample per group against equivalence margin
Equivalence marginRequired sample per group
0.30061,661
0.7621,959
1.22606
1.68298
2.15179
2.61120
3.0786
3.5365
3.9951
4.4541

When to use it

Use an equivalence test when the conclusion you want is "these two are interchangeable" rather than "these two differ". A cheaper vendor whose handling time must not change, a refactor that should leave average basket value where it was, a shorter survey that should recover the same mean score — the decision is to swap one thing for another, and the evidence you need is that the difference is too small to care about.

That is not the question a significance test asks. Failing to reject is a statement about the power of your study, not about the world: run a two-sample t-test on twelve observations per arm and you will fail to reject almost anything. Treating p > 0.05 as proof of sameness is the most common inferential error in product analytics, and the sloppier the experiment the likelier it becomes. We work the logic through in when being good enough is enough.

Choose this page when a difference in either direction would concern you. If only one direction matters, use non-inferiority for two means — cheaper, and the honest description of most "can we ship the cheaper thing?" decisions. If the outcome is a rate, go to equivalence for two proportions. If the same units are measured twice, the pairing belongs in the analysis: start from the paired t-test and apply the margin to the mean of the differences.

Assumptions

TOST inherits every assumption of the t-test it is built from, and adds one of its own that is not statistical at all:

  • The margin is set before you see the data. A margin chosen after looking at the observed difference is not a hypothesis test but a description of the data with a p-value attached. Write it into the plan alongside the metric and the stopping rule.
  • The margin is a business decision. It is the largest difference you would accept in exchange for whatever the change buys, and that answer comes from finance or product rather than from a formula. Half a standard deviation is not a margin; "eighteen cents per session" is.
  • Independence, within and between groups — unchanged from the two-sample t-test. Clustering shrinks the standard error, which in an equivalence test means falsely concluding equivalence. The error runs opposite to the direction people check for.
  • Approximate normality of the two sample means, which the Central Limit Theorem covers at a few hundred observations per arm. Heavy tails remain a real problem — see what to do when data is not normally distributed. Welch's standard error is the default here, so unequal variances are already handled.

How the calculation works

Two one-sided tests, each run at the full α. The first asks whether the difference is comfortably above the lower margin, the second whether it is below the upper one; equivalence is concluded only when both reject, and the p-value we report is the larger of the two. Because both tests are one-sided at α, the interval that agrees with the procedure is the (1 − 2α) interval — 90% at α = 0.05, not the 95% you would quote beside [an ordinary t-test](/calculators/two-sample-t-test) — and equivalence holds exactly when it lies inside ±Δ.

The two one-sided tests
t₁ = (d − (−Δ)) / SE, t₂ = (Δ − d) / SE

d is the observed difference and ±Δ the margin. Both go against t₁₋α,df in the upper tail; equivalence needs both to reject.

Reported p-value
p = max(p₁, p₂)

The maximum, not the minimum. The rejection region is an intersection rather than a union, so running both tests at α leaves the overall error rate at α.

Standard error (Welch)
SE = √(s₁²/n₁ + s₂²/n₂)

Same denominator and Welch–Satterthwaite degrees of freedom as the ordinary test. The equivalence framing changes nothing about how the difference is estimated.

The agreeing interval
d ± t₁₋α,df · SE (a 1 − 2α interval)

At α = 0.05, a 90% interval. Printing a 95% one beside a TOST result is a classic error — in a band of borderline results the p-value says equivalent while the interval appears not to.

Sample size, assuming no true difference
n = 2σ²(z₁₋α + z₁₋β/₂)² / Δ²

The z₁₋β/₂ is not a typo. Both tests must reject, so the power requirement splits across two tails — precisely the step the "two-sided power at the margin" shortcut skips.

Sample size, with an assumed true difference
n = 2σ²(z₁₋α + z₁₋β)² / (Δ − |d₀|)²

d₀ is the difference you actually expect. Power collapses as d₀ approaches the margin, so a design assuming perfect equality quotes its best case — and calculators with no d₀ field overstate power for that reason.

Worked example

You are moving support tickets from one outsourced vendor to another. The new contract is cheaper, and the only thing that must not change is how long a ticket takes to close: within a minute of the current average is operationally invisible, beyond that customers notice. Handling time historically averages 21 minutes with a standard deviation of 6. You plan against a true gap of 0.2 minutes rather than assuming the vendors are identical.

Significance level (α)
0.05, each one-sided test
Power (1 − β)
0.90
Equivalence margin (±Δ)
±1.0 minute
Assumed true difference (d₀)
0.2 minutes
Standard deviation (σ)
6.0 minutes
Allocation ratio
1:1

975 tickets per vendor, 1,950 in total. Had you assumed the two vendors were exactly identical, the same design would have asked for 780 per arm.

Two things there are worth carrying away. A 0.2-minute assumed gap — a fifth of the margin — added a quarter to the sample, because equivalence power depends on the room between the true difference and the margin, not on the margin alone. And the margin has enormous leverage: tighten it to ±0.5 minutes at the same assumed gap and the requirement rises to roughly 6,850 per arm. For comparison, a conventional test powered to detect a one-minute difference would need 758. Proving sameness costs more than finding a difference of the same size.

Interpreting the output

Read the reported p-value as the weaker of two claims. Below α, both one-sided tests rejected and the data is consistent with a difference small enough to ignore — at the margin you nominated, and only at that margin. Someone who thinks half your margin is the real threshold has not been given an answer, so put the margin in the headline rather than a footnote.

Then read the 90% interval, because it says more. Entirely inside ±Δ, you have equivalence. Straddling a margin, you do not, and the interval shows which end is the problem and by how far. Wider than the margins on both sides, and the study was simply too small. A result can be both non-significant against zero and non-equivalent, which is what an underpowered study looks like from the inside.

The reverse combination catches people out too: a difference can be significant and equivalent at once. With a large enough sample, two seconds of handling time will have p < 0.001 against zero and still sit well inside a one-minute margin. That is the point — significance asks "distinguishable from zero?", equivalence asks "small enough to ignore?". Report both, as in how to properly report A/B test results.

Finally, equivalence is a claim about the average, not the distribution. Two vendors can share a mean handling time while one has a tail of three-hour tickets that generates every complaint you get. If the tail is what matters, test the tail — a quantile, or the proportion breaching a threshold via equivalence for two proportions. Pressure-testing a margin before it enters a test plan is what our causal inference work is for.

Frequently asked questions

Why can't I just say a non-significant t-test proves no difference?
Because absence of evidence is not evidence of absence, and the smaller your study the easier it is to produce. A t-test with 30 observations per arm fails to reject almost any difference you care about; the p-value above 0.05 is telling you about your sample size, not about the two groups. An equivalence test inverts the burden of proof: the null hypothesis is that the difference is at least as large as the margin, and you have to gather enough evidence to reject it. That is the only way round that lets a positive result mean what you want it to mean.
How do I choose the equivalence margin?
Ask what difference would change the decision. If the new vendor is 15% cheaper, how much slower could they be before the saving is not worth it? That number, converted into the units of your metric, is the margin. Common shortcuts are worse than they look: half a standard deviation is a statistical convention with no business content, and a fixed 5% relative margin will be far too loose on some metrics and unattainable on others. Whatever you choose, choose it in writing before the data lands, because a margin picked afterwards can always be made to give the answer you were hoping for.
Should I report a 90% or a 95% confidence interval with a TOST?
90%, when alpha is 0.05. The TOST procedure is two one-sided tests each run at 5%, and the interval that agrees with it is the 1 minus 2 alpha interval, so equivalence holds exactly when the 90% interval falls inside the margins. Printing a 95% interval beside a TOST p-value creates a visible contradiction in a band of borderline results, where the p-value declares equivalence and the wider interval appears to overlap a margin. Both numbers are correct; they are simply answering questions at different confidence levels, and only one of them matches the test you ran.
My other calculator gives a much smaller sample size. Which is right?
Check whether it is computing the power of a two-sided test to detect a difference equal to the margin. That shortcut is common and it overstates power, because it ignores the requirement that both one-sided tests reject and it implicitly assumes the true difference is exactly zero. The gap is widest at high power and when you expect any real difference at all. If a tool has no field for the difference you actually expect, it is almost certainly using the shortcut.
Do the two groups need equal variances?
No. The standard error here is Welch's, which allows the two groups to have different spreads at a cost of a fraction of a degree of freedom. That matters more in equivalence work than in ordinary testing, because the point of many equivalence studies is to compare two genuinely different systems — an old vendor and a new one, a heavyweight model and a cheap one — and there is no reason for two different systems to produce identically variable outcomes.
Can I test one group against a fixed benchmark instead of another group?
Yes, and it is cheaper: with a known target value there is only one source of sampling error rather than two, so the required sample is roughly halved. The procedure is the same — two one-sided tests of the sample mean against the benchmark plus and minus the margin — but be careful that the benchmark really is known rather than estimated from a previous period. A historical average carries its own uncertainty, and treating it as fixed will make your interval too narrow and your equivalence claim too confident.

Related calculators

  • Two-sample t-test

    Compare the average of two independent groups — plan the sample size, then test the result.

  • Paired t-test

    Before-and-after or matched pairs — size the study on the difference SD, then test it.

  • Non-inferiority: two means

    Show an average is not meaningfully worse — one margin, one direction, one-sided p-value and confidence bound.

  • Equivalence: two proportions

    Prove two rates are close enough to swap — margin in percentage points, sample size, then both one-sided tests.

Terms on this page

  • Type II error

    The false negative — invisible by nature, which is why nobody counts how many good ideas it kills.

Talk to the people who build these for a living

We help teams write down the margin that makes a swap acceptable before the test runs, so the result is a decision rather than an argument. Causal Inference Analysis

References