BCompare groups · Guide test 047
Dunnett T3 test
Provides all pairwise mean comparisons under unequal variances using a studentized maximum modulus approach.
Do it in CodeSplash
In the app, set it up in Analyze with this method:
- Pairwise comparisons (Tukey, Games–Howell, Dunnett, Dunn, Steel–Dwass …) — Which groups differ from which?
In One-way ANOVA (Welch / classic), choose Post hoc comparisons = Dunnett T3. In Pairwise comparisons (Tukey, Games–Howell, Dunnett, Dunn, Steel–Dwass …), choose Comparison = Dunnett T3.
Do it in CodeSplash Run this test on your own data, in Python or R.
Bench
Change the design, drag the data, move α. The statistic, its reference distribution and the verdict follow.
Bench · Dunnett T3 test
Group i has true mean (i − 1) × spread.
Your data
Drag a point or use ↑/↓ to change itIf H₀ were true
- The reference: how |t| varies across samples when H₀ is true, the studentized maximum modulus, 6 pairs, df 9.0.
- Your statistic, from the data above.
- The p-value: the area at least as extreme as yours (p = .143).
- The hatched rejection region at α = .050: statistics landing here reject H₀.
The whole family
| Pair | Difference in means with 95% simultaneous interval | p | p adj. |
|---|---|---|---|
| .646 | .997 | ||
| .434 | .949 | ||
| .030 | .143 | ||
| .705 | .999 | ||
| .074 | .333 | ||
| .184 | .661 |
6 pairs; adjusted by studentized maximum modulus. The highlighted row is the one in the reference pane (the most extreme by default).
The formula
With your numbers
- studentized maximum modulus for m pairs
- the pair's Welch df
The verdict
|t| = 2.58, p = .143, Δ = −2.34
p > α = .050: compatible with H₀
Effect size: Group 1 − Group 4 (difference in means) Δ = −2.337
Like T2 but with the studentized maximum modulus, which is tighter than Šidák when groups are small.
- Statistic
- 2.583
- p-value
- 0.1430
Dunnett T3 test on Group 1: n = 8; Group 2: n = 8; Group 3: n = 8; Group 4: n = 8: |t| = 2.58, p = .143, Δ = −2.34. The p-value is above α = .050, so the data are compatible with H₀.
Question and hypotheses
H0ij: μi=μj for each pair of independent groups.
Assumptions
Independent groups and independent observations; approximately normal within group sampling for small sample inference; variances may differ.
Formula
Parameters and notation
k is the group count; ni, x̄i, si² are group summaries; m is the number of pairwise comparisons.
Structure of the method
Construct unequal-variance pairwise t statistics and fractional Welch degrees of freedom, then use the studentized maximum modulus reference for the selected all-pairs family. This reference differs from both the studentized range used by Games–Howell and the correlated multivariate t used by original control-comparison Dunnett testing.
Estimated and nuisance parameters
Estimate group means and variances, with derived standard errors and degrees of freedom for each pair. The number of comparisons and group identities are fixed family-design inputs. A numerical tail calculation for the maximum-modulus distribution is a computational approximation, not a learned distribution fitted to the observed p-values.
Settings and design choices
Choose familywise alpha, included groups, measurement transformation, and numerical tolerance or integration settings available in the implementation. Preserve the maximum-modulus convention when reproducing results across software. Substituting a Tukey range or ordinary t tail because it is easier to access does not implement Dunnett T3.
Fitting and adaptation
Recompute pairwise summaries and multiplicity parameters when observations or groups change. A simultaneous analysis should report all planned comparisons, including nonsignificant ones, to preserve the family context. If observations are matched, clustered, or longitudinal, use an appropriate joint model rather than adapting only the pairwise denominator.
Sensitivity and robustness
Approximation accuracy can suffer with tiny groups, large variance ratios, or heavy tails. Numerical implementations of less common reference distributions deserve version and tolerance reporting. The method targets mean contrasts and does not become robust to outliers merely because it permits unequal variances or bears a multiple-comparison adjustment.
How to use and calibrate
Use |tij| with the studentized maximum modulus distribution for m comparisons and pair specific νij.
Example application
Compare treatment means when group variances and sample sizes differ.
Interpretation and pitfalls
Watch out
This is Dunnett T3, not the original many-to-one Dunnett test or Tukey range distribution.
What changed in edition 2
- New sections: structure of the method, estimated and nuisance parameters, settings and design choices, fitting and adaptation, sensitivity and robustness.
Python and R
Read the matrix of adjusted p-values. This is an independent-group example; Nemenyi also has a separate Friedman/block version. The first factor level is control for many-to-one procedures.
Not run — Python launcher syntax checked; R backend runtime not verified · needs Python standard library + Rscript; R packages: PMCMRplus
# Python launcher for the complete R implementation below.
# Requires Rscript on PATH and the listed R packages.
import shutil
import subprocess
rscript = shutil.which("Rscript")
if rscript is None:
raise RuntimeError("Install R and make Rscript available on PATH.")
r_code = r"""
set.seed(2026)
d <- data.frame(value=c(rnorm(20),rnorm(20,.4),rnorm(20,.8)), group=factor(rep(c("A","B","C"),each=20)))
print(PMCMRplus::dunnettT3Test(value~group,data=d))
"""
# No shell interpolation. A failed R execution raises an error in Python.
result = subprocess.run([rscript, "--vanilla", "-"], input=r_code,
text=True, capture_output=True)
print(result.stdout)
if result.stderr:
print(result.stderr)
result.check_returncode()
Not run — Syntax checked; runtime not verified in the final environment · needs PMCMRplus
set.seed(2026)
d <- data.frame(value=c(rnorm(20),rnorm(20,.4),rnorm(20,.8)), group=factor(rep(c("A","B","C"),each=20)))
print(PMCMRplus::dunnettT3Test(value~group,data=d))
Sources
- PMCMRplus — PMCMRplus · dunnettT3TestAuthor documentation/source reviewed: PMCMRplus 1.9.12.search.r-project.org
- dunnettT3Testsearch.r-project.org
- Statistics guide v4 (historical):
- Python: Python launcher syntax checked; R backend runtime not verified · R: Syntax checked; runtime not verified in the final environment
- Reference's record:
- Edition 2 review: Python: skip · R: not executed (Rscript unavailable); why not run: Python: Python-to-R bridge; Rscript is unavailable. R code was not executed. Python: Not run in the reference's review: Python-to-R bridge; Rscript is unavailable. R code was not executed. R: Reviewed but not run: R wasn't available to the reference's authors.
From the CodeSplash statistics guide (v4), entry 047, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT047.