Showing two things are close enough with TOST
A large p-value doesn't show the absence of an effect. Equivalence testing asks directly whether the effect lies inside bounds you chose in advance.
What runs in CodeSplash
- STAT283Two one sided tests procedure or TOST Runs in CodeSplash
- STAT284Welch TOST Runs in CodeSplash
- STAT285Paired TOST Runs in CodeSplash
- STAT286Wilcoxon TOST Runs in CodeSplash
- Equivalence and minimal-effect tests (TOST) Verified in Python and R
- Two-sample t-test (Welch / Student, or z test) Verified in Python and R
- Paired t-test Verified in Python and R
You will be able to
- Explain why a non-significant test doesn't demonstrate equivalence
- Run two one-sided tests against pre-chosen bounds
- Read the four possible outcomes of an effect and its interval
Read first
Absence of evidence
ReadTo show that two treatments are similar, you have to say what "similar" means. The bounds define the smallest effect size of interestSmallest effect size of interestThe smallest effect that would matter in practice; below it, an effect is treated as negligible.: anything inside them is too small to matter.
Set these before you see the data, from clinical, commercial or scientific reasoning.
Flip the null
ReadAn equivalence testEquivalence testTests whether an effect is small enough to ignore, by rejecting effects beyond ± the SESOI. makes the difference the null and equivalence the claim:
Two one-sided tests (TOST) run one test against each bound. You must reject both, so the TOST p-value is the larger of the two. Equivalently: the 90% confidence interval lies entirely inside the bounds.
Move the bounds
ExploreWiden and narrow the bounds and watch the interval. Then raise the sample size. Can you find a setting that's significantly different from zero and equivalent at once?
BExplorable · Two one-sided tests
How do you show that two things are the same, not merely that you found no difference?
What can you conclude here?
Inconclusive: neither test rejects
Equivalent when the whole 90% interval sits inside the margins. TOST p = .068; ordinary test p = .618.
Commit your prediction above to see the result
Make your prediction to see the result.
Predict the verdict
PredictPredict first
ToothGrowth with bounds of ±½ SD, which is ±3.74 units. The observed difference is 3.70. The ordinary Welch test gave p = .061.
What does TOST conclude?
Reveal
Not shown equivalent, not significantly different. The 90% interval runs from 0.47 to 6.93, poking through the upper bound; TOST gives p = .492. The data can't distinguish a real difference from no difference, so the study is inconclusive.
Four outcomes
Read| The interval | Difference test | TOST | Read as |
|---|---|---|---|
| Inside bounds, excludes 0 | Significant | Equivalent | Real but too small to matter |
| Inside bounds, includes 0 | Not significant | Equivalent | Negligible |
| Crosses a bound, includes 0 | Not significant | Not equivalent | Inconclusive |
| Outside bounds, excludes 0 | Significant | Not equivalent | Meaningful |
Sleep data, paired, ±1 hour: a difference of −1.58 hours gives ordinary p = .003 and TOST p = .915. That's a real difference and not an equivalence.
Equivalence can be shown: mtcars mpg against 20 with bounds ±2 passes both one-sided tests, TOST p = .041.
Other scales
ReadTOST isn't only for means. Wilcoxon TOST uses the Hodges–Lehmann shift: an estimate of 0.600 against bounds ±0.500 gives p = .675. That example compares two independent groups (the Mann–Whitney form). Fill Second measurement (paired design) instead and it becomes the paired signed-rank form, with its own shift and assumptions: choose the design on purpose.
Brunner–Munzel TOST bounds the relative effect: = 0.64 between 0.35 and 0.65 gives p = .443.
Check your understanding
CheckpointCheck yourself
The two one-sided tests give p = 0.01 and p = 0.08. What is the TOST p-value, and is equivalence shown at the 5% level?
Show the answer
Answer: b
You must reject both one-sided tests, so the larger p-value decides. There's no multiplicity penalty, because both must succeed.
Check yourself
Which interval must lie inside the bounds for TOST at α = 0.05?
Show the answer
Answer: a
Each one-sided test has α = 0.05, which matches the two ends of a 90% interval.
Check yourself
When should you choose equivalence bounds?
Show the answer
Answer: a
Bounds chosen after seeing the data can be stretched to fit anything, which makes the test meaningless.
Do it in CodeSplash
In the appUse Equivalence and minimal-effect tests directly, with Lower bound, Upper bound and Bounds are set to raw units or standardized d. Or turn on the Lens option in a t test, Mann–Whitney, Yuen, correlation or Poisson rates, and pick Equivalence (TOST).
import pandas as pd
from statsmodels.stats.weightstats import ttost_ind
df = pd.read_csv("toothgrowth.csv")
oj = df.loc[df["supp"] == "OJ", "len"]
vc = df.loc[df["supp"] == "VC", "len"]
print(ttost_ind(oj, vc, low=-3.741, upp=3.741, usevar="unequal"))df <- read.csv("toothgrowth.csv")
oj <- df$len[df$supp == "OJ"]
vc <- df$len[df$supp == "VC"]
# Two one-sided tests; the larger p-value is the TOST p-value.
t.test(oj, vc, mu = -3.741, alternative = "greater")
t.test(oj, vc, mu = 3.741, alternative = "less")Recap
Recap- To claim two things are close, test that claim against bounds chosen in advance.
- TOST rejects both one-sided nulls, which matches a 90% interval inside the bounds.
- A result can be significant and equivalent, or neither. Both can happen and both are informative.
Concepts in this lesson