Advanced maths

Post hoc pairwise comparison calculator from grouped data

Compare independent groups with Tukey–Kramer, Games–Howell or tie-corrected Dunn–Holm tests, reporting pair effects and family-adjusted probabilities.

Your numbers

2–10 rows, each 3–200 observations. Unequal group sizes are supported.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

An omnibus group test can show that not every group behaves alike without identifying which pairs differ. Post-hoc comparisons address those pairs while accounting for a family of tests. This page keeps three related procedures together: Tukey–Kramer for means under a common variance model, Games–Howell for means with unequal variances, and Dunn–Holm for pooled-rank comparisons. The method selector changes both the effect scale and the reference distribution, so its assumptions must be chosen from the study design rather than whichever option produces a smaller p-value.

THE FORMULATukey q=|meanᵢ−meanⱼ|/sqrt(MSE(1/nᵢ+1/nⱼ)/2); Games–Howell uses pair variances/df; Dunn uses tie-corrected pooled mean ranks and Holm adjustment.

A worked example

For groups A=(1,2,3,4), B=(2,3,4,5) and C=(4,5,6,7), the sample means are 2.5,3.5 and 5.5. Tukey–Kramer compares A−B=−1, A−C=−3 and B−C=−2 using their common within-group mean square, which is 5/3. Each group has four observations, so the studentized-range denominator is sqrt((5/3)(1/4+1/4)/2)=sqrt(5/12). The q statistics are the absolute differences divided by that denominator, and probabilities account for all three groups simultaneously.

Good to know

2–10 independent groups with 3–200 finite observations each. Tukey assumes common normal-error variance; Games–Howell uses pair-specific variance and Welch degrees of freedom; Dunn uses global pooled ranks with ties and Holm-adjusted two-sided normal probabilities. Numeric studentized-range integration can raise explicit tolerance/resource errors. Zero pair variance and all-equal rank data are rejected. No simultaneous confidence intervals, repeated-measures procedure, automatic assumption selection or median interpretation without distribution-shape assumptions.

The denominator and the effect scale must match the method

Tukey–Kramer pools within-group squared deviations and uses a shared residual degrees of freedom. Unequal sample sizes change each pair’s denominator but do not require another page. Games–Howell replaces the pooled variance with the two groups’ estimated mean variances and computes a pair-specific Welch–Satterthwaite degrees of freedom. Both use a studentized-range q statistic; their displayed denominator contains a factor of one half and should not be confused with the ordinary t-test standard error.

Dunn first ranks every observation in the combined sample. Tied values receive their shared average rank, and a global tie correction reduces the rank variance. Its effect column is a difference of pooled mean ranks, not original sample means. A rank difference can be useful for ordinal data, but it is not automatically a difference of population medians when shapes or spreads differ. Choosing a method changes the scientific question as well as the calculation.

Three group means produce three pairwise differences under a common variance modelA: 2.5B: 3.5C: 5.5A−B = −1; A−C = −3; B−C = −2One family: 3 unordered pairs
Means 2.5,3.5,5.5 give signed A−B=−1, A−C=−3 and B−C=−2. In the equal-size worked example, pooled variance is 5/3 and the Tukey q denominator is sqrt(5/12). Range probabilities account for the three-group family.

Multiplicity is adjusted across the displayed family

Tukey probabilities are evaluated against the range distribution for the whole group count rather than a separate unadjusted normal test for each pair. Games–Howell applies its approximate range calibration with pair-specific degrees of freedom. Dunn’s raw two-sided normal probabilities are sorted for Holm’s step-down procedure, and adjusted values are made monotone. The output reports adjusted probabilities directly so an ordinary significance cutoff is not accidentally applied to raw values.

Running many pair tests and reporting only the smallest p-value hides the family that produced it. This page includes every unordered pair from the entered groups and fixes that family before examining results. It does not require an automatic preliminary significance gate, nor does it use a variance test to select whichever comparison is most favorable. The One way ANOVA groups calculator answers an omnibus mean question; this page adds the specific pairwise comparisons with their stated multiplicity protection.

A few questions, answered

Why can Games–Howell give each pair a different degrees of freedom?

Each pair uses its own two estimated mean variances and sample sizes. Their Welch–Satterthwaite combination need not match the common pooled degrees of freedom.

Does Dunn–Holm compare group means?

It compares pooled mean ranks, with tie correction and Holm adjustment. Its effect column is on the rank scale and is not the raw mean difference.

Find your calculator

Start typing to explore the library.