Skip to content

BCompare groups · Guide test 050

Conover–Iman test

Compares group rank sums following an omnibus rank based analysis.

Runs in CodeSplashPython (calls R) example not runR example not run

Do it in CodeSplash

In the app, set it up in Analyze with one of these methods:

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

4
10
0.65

Group i has true mean (i − 1) × spread.

1.00
0.050

Your data

Drag a point or use ↑/↓ to change it
Group 1mean 0.49Group 2mean 0.88Group 3mean 1.23Group 4mean 1.73

If H₀ were true

|t| = 2.98
  1. The reference: how |t| varies across samples when H₀ is true, the Bonferroni bound on 6 pairs, |t| df 36.
  2. Your statistic, from the data above.
  3. The p-value: the area at least as extreme as yours (p = .031).
  4. The hatched rejection region at α = .050: statistics landing here reject H₀.

The whole family

PairDifference in mean rankspp adj.
.1771.000
.079.472
.005.031
.6681.000
.117.704
.2491.000

6 pairs; adjusted by Bonferroni. The highlighted row is the one in the reference pane (the most extreme by default).

The formula

tij=Rˉi−RˉjS2 N−1−HN−k(1ni+1nj)t_{ij}=\dfrac{\bar R_i-\bar R_j}{\sqrt{S^2\,\tfrac{N-1-H}{N-k}\left(\tfrac{1}{n_i}+\tfrac{1}{n_j}\right)}}

With your numbers

t=(−2.98),padj=0.03t = (-2.98),\qquad p_{adj} = 0.03
HH
the Kruskal–Wallis statistic
S2S^2
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 H0.

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

tij=Rˉi−RˉjSR2D(1/ni+1/nj)D=N−1−HcN−k\begin{gathered}t_{ij}=\frac{\bar R_i-\bar R_j}{\sqrt{S_R^2D(1/n_i+1/n_j)}}\\[5pt] D=\frac{N-1-H_c}{N-k}\end{gathered}

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.

Python · invokes R

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()
R

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

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.