BCompare groups · Guide test 050
Conover–Iman test
Compares group rank sums following an omnibus rank based analysis.
Do it in CodeSplash
In the app, set it up in Analyze with one of these methods:
- Friedman test (repeated measures, ranks) — Do three or more conditions measured on the same subjects differ in location?
- Pairwise comparisons (Tukey, Games–Howell, Dunnett, Dunn, Steel–Dwass …) — Which groups differ from which?
In Kruskal–Wallis test, choose Pairwise test = Conover–Iman. In Pairwise comparisons (Tukey, Games–Howell, Dunnett, Dunn, Steel–Dwass …), choose Comparison = Conover–Iman.
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 · Conover–Iman 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 Bonferroni bound on 6 pairs, |t| df 36.
- Your statistic, from the data above.
- The p-value: the area at least as extreme as yours (p = .031).
- The hatched rejection region at α = .050: statistics landing here reject H₀.
The whole family
| Pair | Difference in mean ranks | p | p adj. |
|---|---|---|---|
| .177 | 1.000 | ||
| .079 | .472 | ||
| .005 | .031 | ||
| .668 | 1.000 | ||
| .117 | .704 | ||
| .249 | 1.000 |
6 pairs; adjusted by Bonferroni. The highlighted row is the one in the reference pane (the most extreme by default).
The formula
With your numbers
- the Kruskal–Wallis statistic
- variance of all the ranks
The verdict
|t| = 2.98, p = .031, ΔR̄ = −14.50
p ≤ α = .050: reject H₀
Effect size: Group 1 − Group 4 (difference in mean ranks) ΔR̄ = −14.500
Mean ranks with the Kruskal–Wallis residual variance on N − k df: more powerful than Dunn. Bonferroni-adjusted here.
- Statistic
- 2.983
- p-value
- 0.0306
Conover–Iman test on Group 1: n = 10; Group 2: n = 10; Group 3: n = 10; Group 4: n = 10: |t| = 2.98, p = .031, ΔR̄ = −14.50. The p-value is below α = .050, so the data are hard to reconcile with H₀.
Question and hypotheses
H0ij: equal rank locations for a pair in a k group comparison.
Assumptions
Independent observations and independent groups; ordinal or quantitative measurements. The permutation null is identical group distributions. A location or median interpretation additionally needs comparable distribution shapes.
Formula
Parameters and notation
SR² is pooled rank variance; Hc is tie corrected Kruskal–Wallis statistic; k groups,N observations.
Structure of the method
Use globally pooled group rank means, but scale pairwise differences with a residual-like rank variance that incorporates the tie-corrected Kruskal–Wallis statistic. The usual version uses t tails with N-minus-k degrees of freedom, followed by a stated adjustment. Its denominator is intentionally different from Dunn's null rank variance.
Estimated and nuisance parameters
Estimate global rank variance, group rank means, and the omnibus rank statistic used in the scaling factor. The number of groups and observations determine the residual degrees of freedom. This is not a raw-data ANOVA fit, even though the rank-residual interpretation resembles an analysis-of-variance decomposition.
Settings and design choices
Specify the post-hoc protocol, eligible pair family, alpha, and Holm, Bonferroni, or the documented single-step alternative. A switch between t-plus-adjustment and studentized-range versions changes calibration. Keep ties and missing-data policies aligned between the omnibus statistic and pairwise stage; mixing incompatible corrections changes the denominator.
Fitting and adaptation
Re-rank all observations and recompute the omnibus-dependent scale whenever the dataset changes. If the procedure is used after an omnibus rejection, report that gate explicitly. New group inclusion affects both global ranks and the residual scale, so old pairwise outputs cannot simply be appended to new comparisons.
Sensitivity and robustness
Strong group separation can shrink the residual rank scale, while small samples and ties can make approximate tails unreliable. Different software may use different post-hoc conventions. This procedure should not be presented as interchangeable with Dunn, re-ranked Mann–Whitney comparisons, or a general test of equal medians under arbitrary shapes.
How to use and calibrate
Use tN−k with a stated multiplicity adjustment; a single step studentized range version also exists.
Example application
Localize differences after a rank based omnibus analysis.
Interpretation and pitfalls
Watch out
This denominator differs from Dunn’s. State the post hoc protocol and correction instead of reporting an ambiguous “rank post hoc test.”
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::kwAllPairsConoverTest(value~group,data=d,p.adjust.method="holm"))
"""
# 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::kwAllPairsConoverTest(value~group,data=d,p.adjust.method="holm"))
Sources
- PMCMRplus — PMCMRplus · kwAllPairsConoverTestAuthor documentation/source reviewed: PMCMRplus 1.9.12.search.r-project.org
- kwAllPairsConoverTestsearch.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 050, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT050.