Premium Writing, Design & Advisory · Dubai, UAE

Kruskal–Wallis test: interpretation, post hoc comparisons and reporting

The Kruskal–Wallis test compares an ordered outcome across independent groups using ranks pooled across all observations. A significant result supplies evidence against the null that the groups have the same outcome distribution. To find which groups differ, define a family of pairwise comparisons and use a method such as Dunn’s test with Holm adjustment.

Three groups of eight pale ceramic counters on dark slate

Check that your observations are independent

Identify one row per independent observational unit. In a study comparing three teaching activities, each learner might complete just one activity and one assessment. The score has an order, so a larger value has the same meaning across groups. If learners complete all three activities, their scores are paired. If whole classes receive an activity and scores within a class are correlated, the class-level assignment and within-class dependence must enter the analysis. Ranking individual scores does not solve either problem.

Write down what you want to compare before selecting a test. If your research question concerns a difference in means, consider an analysis that estimates a mean difference and addresses the design and variance structure. If the question concerns rank tendencies in independent groups, a rank-based analysis may fit. The statistical test selection guide covers the broader choice.

Interpret ranks before interpreting medians

In the original rank procedure, the test pools the observations and replaces their values with ranks. Equal scores share the average of the positions they occupy. Under the null, the assignment of ranks to groups should be compatible with samples from the same distribution. A group with many high scores tends to have a higher mean rank. Differences in shape or spread can make a simple location interpretation misleading.

Plot each observation by group and report the group sizes and medians. If shapes and spreads are reasonably comparable, a location-shift interpretation may be defensible given the design. If one group has a long tail or piles up at the maximum score, describe those features and interpret the result as a rank comparison. Groups with equal medians may have different distributions, and the Kruskal–Wallis statistic does not detect every possible way those distributions can differ.

Work through a three-group example with ties

The scores below are fictional. Each learner appears once. Identical scores can occur across different groups, and ranking them separately would erase the common comparison scale.

GroupScoresMedianRank sum
A3, 4, 4, 5, 5, 6, 7, 8556
B4, 5, 6, 6, 7, 8, 8, 96.591
C7, 8, 8, 9, 9, 10, 11, 129153

The three scores of 4 occupy positions 2 through 4 and each receives rank 3. All 24 ranks sum to 300. A useful arithmetic check is that the group rank sums also total 300. Dividing the three rank sums by eight gives mean ranks of 7, 11.375 and 19.125, respectively. The correction for ties is 0.982609. The corrected statistic is H = 12.279. The chi-square reference distribution with two degrees of freedom gives p = 0.00216.

The chi-square calculation is an approximation. Very small samples, coarse scores with many ties or severe imbalances warrant reviewing whether the approximation is appropriate. A permutation procedure can supply a reference distribution where the observations are exchangeable under the null and the permutation respects how the groups were assigned. A restricted randomisation or clustered study needs a procedure that respects its restrictions.

Use a planned comparison family

Here the follow-up question is which of the three group pairs accounts for the separation in ranks. Dunn’s test compares mean ranks from the pooled observations with a tie-adjusted standard error. The example uses two-sided p values and adjusts all three comparisons together with Holm’s procedure. If your study has several outcomes or several comparison families, document how each was defined and how you controlled error for the claims you intend to make.

ComparisonDunn zRaw pHolm-adjusted p
A versus B−1.2480.211910.21191
A versus C−3.4600.000540.00162
B versus C−2.2110.027010.05402

At the prespecified familywise threshold of 0.05, only A versus C crosses the threshold. B versus C illustrates why reporting both p values is helpful. Its raw p is below 0.05 while its adjusted result is above it. The latter does not establish equality. Report the direction and observed distributions along with the adjusted evidence.

Calculate and interpret the omnibus effect size

The p value addresses evidence against the null hypothesis. A rank-based effect size describes how strongly the pooled ranks are separated by group. In the worked example, the tie-corrected statistic is H = 12.279, the total sample size is n = 24 and the number of groups is k = 3. Tomczak and Tomczak’s review of effect sizes gives two omnibus measures that use the Kruskal–Wallis statistic.

  • Rank epsilon squared (ε²). Divide H by n − 1. Here, 12.279 ÷ 23 = 0.534 to three decimal places. This is equivalent to H(n + 1)/(n² − 1).
  • Rank eta squared based on H (η²H). Calculate (H − k + 1)/(n − k). Here, (12.279 − 3 + 1) ÷ (24 − 3) = 0.489.

Choose one measure in advance and name its formula, especially if your software uses different labels. Neither measure tells you how many score points separate the groups or which pair accounts for the result. Report the observed medians and spread for context. If practical importance concerns a pair, report a separately defined estimate that answers that question, with an interval appropriate to the design. Generic labels such as “small” and “large” are conventions. Use the measurement scale, prior studies and substantive consequences to explain why a difference matters in your field.

Check software settings and avoid common mistakes

Save the software version and command or settings. Check whether the omnibus statistic is corrected for ties, what reference distribution supplies the p value, and whether the pairwise routine uses pooled ranks and adjusts over the intended family. Some commands display raw and adjusted p values together. Label both clearly if you report both, and make your decision using the adjustment stated in your analysis plan.

  • Ranking within groups. Rank all groups together so that a rank has the same meaning across the sample.
  • Running unadjusted pairwise tests. Define the comparison family first. A separate Mann–Whitney test ranks only the two groups it uses and is not equivalent to the pooled-rank Dunn procedure used here.
  • Calling every result a difference in medians. Inspect distributions and explain any important differences in spread or shape before using a location interpretation.
  • Treating repeated observations as independent. Use a paired or repeated-measures method suited to the design if the same participants appear in multiple groups or conditions.

Write a methods and results paragraph

A reproducible methods paragraph identifies the observational unit, outcome scale, groups, handling of missing values, approximation, tie treatment, comparison family and software version. In the results, give summaries and the test statistic, degrees of freedom and p value. Include the pairwise results and label the correction. State whether the comparisons were planned or exploratory.

For the fictional example: Scores differed across the three groups in the tie-corrected Kruskal–Wallis test, H(2) = 12.28, asymptotic p = 0.0022. With eight learners per group, medians were 5, 6.5 and 9 for A, B and C. In two-sided Dunn comparisons with Holm adjustment across all three pairs, A had a lower mean rank than C (adjusted p = 0.0016). The adjusted p values for A versus B and B versus C were 0.212 and 0.054, respectively.

Ask whether your report also needs an interpretable effect estimate and an interval. Choose one that matches the research question and define its direction. Preserve the script or input record so another researcher can reproduce ties, exclusions and adjustment.

Common questions

Does a significant omnibus test identify the groups that differ?

No. It supplies evidence against the common-distribution null. The pairwise comparisons address narrower questions and should respect the stated multiplicity plan.

Can I run it on pre- and post-treatment observations from the same people?

An independent-groups Kruskal–Wallis analysis does not account for repeated measurements. Use a method that represents the pairing or repeated-measures structure of your design.

If you need to check the design, interpretation or reporting of your own study, see research data analysis support, Talk to a Labeeb Expert or send a project enquiry. You remain the author and responsible for the analysis and claims.

Sources

Kruskal and Wallis (1952), use of pooled ranks · Dunn (1964), multiple comparisons using rank sums · Holm (1979), sequential multiple testing.

Talk to LabeebMon–Sat, 9 AM–9 PM Dubai time. Closed Sunday.