Answer

How to report Mann-Whitney U and Kruskal-Wallis results in APA style

A frequently asked statistics question ·

nonparametriceffect sizeapa style

The short answer

For Mann-Whitney, give each group's median, IQR and n, then U, z, p and an effect size, e.g. Mdn = 17.65, IQR = 7.17 vs Mdn = 11.65, IQR = 3.97, U = 19, z = 2.70, p = .006, r = .58. For three or more groups, give H with its degrees of freedom, p and epsilon-squared, H(2) = 14.32, p < .001, ε² = .62, followed by adjusted post hoc comparisons.

The short answer

Rank-based tests compare where scores tend to fall, not means, so the write-up describes each group with a median and interquartile range (and n) rather than a mean and standard deviation. After the descriptives come the test statistic, its p value and an effect size. The two templates, with placeholders:

The rest of this page explains each piece, works through an example in R and Python, and ends with finished sentences and a table layout. Whether a rank test was the right choice in the first place is a separate question; see t test or Mann-Whitney in small samples.

What goes into a Mann-Whitney write-up

What goes into a write-up for three or more groups

A worked example in R and Python

The code uses two small fixed data sets: task completion times (minutes) for an old and a new app design, and quiz scores after three teaching formats. It computes the descriptives, the Mann-Whitney test with z and two effect sizes, the Kruskal-Wallis test with epsilon-squared, and Dunn's tests with Holm's adjustment. There is no randomness, so R and Python print the same figures.

R

# Two groups: minutes to finish a task with the old and the new app design
old <- c(14.2, 18.5, 11.9, 22.4, 16.8, 25.1, 13.4, 19.7, 30.2, 15.6)
new <- c(10.4, 12.8, 9.7, 15.1, 11.2, 8.9, 13.9, 17.3, 10.9, 12.1, 20.6, 9.3)

desc <- function(x) round(c(n = length(x), Mdn = median(x), IQR = IQR(x)), 2)
rbind(old = desc(old), new = desc(new))

mw <- wilcox.test(old, new)               # exact p-value (no ties, small n)
n1 <- length(old); n2 <- length(new); N <- n1 + n2
U_old <- unname(mw$statistic)             # R calls it W; it is U for 'old'
z <- (U_old - n1 * n2 / 2) / sqrt(n1 * n2 * (N + 1) / 12)  # normal approximation
round(c(U_old = U_old, U_new = n1 * n2 - U_old, z = z, p_exact = mw$p.value,
        r = abs(z) / sqrt(N), rank_biserial = 2 * U_old / (n1 * n2) - 1), 3)

# Three groups: quiz scores (0-20) after three teaching formats
scores <- list(lecture = c(12, 15, 9, 14, 11, 17, 13, 10),
               seminar = c(8, 6, 11, 7, 9, 5, 10, 8),
               online  = c(13, 16, 12, 18, 14, 11, 19, 15))
t(sapply(scores, desc))

kw <- kruskal.test(scores)                # H is corrected for ties
H <- unname(kw$statistic); n <- sum(lengths(scores))
round(c(H = H, df = unname(kw$parameter), p = kw$p.value,
        epsilon_sq = H / (n - 1)), 4)    # = H / ((n^2 - 1) / (n + 1))

# Dunn's post hoc test (tie-corrected) with Holm's adjustment
y <- unlist(scores); g <- rep(names(scores), lengths(scores))
rk <- rank(y); ng <- lengths(scores)
mean_rank <- tapply(rk, g, mean)[names(scores)]
tie_adj <- sum(table(y)^3 - table(y)) / (12 * (n - 1))
pairs <- combn(names(scores), 2)
z_dunn <- apply(pairs, 2, function(p) (mean_rank[p[1]] - mean_rank[p[2]]) /
  sqrt((n * (n + 1) / 12 - tie_adj) * (1 / ng[p[1]] + 1 / ng[p[2]])))
p_raw <- 2 * pnorm(-abs(z_dunn))
data.frame(pair = paste(pairs[1, ], pairs[2, ], sep = " vs "), z = round(z_dunn, 2),
           p_holm = round(p.adjust(p_raw, "holm"), 4))
round(mean_rank, 2)

Python

import numpy as np
import pandas as pd
from itertools import combinations
from scipy import stats

# Two groups: minutes to finish a task with the old and the new app design
old = np.array([14.2, 18.5, 11.9, 22.4, 16.8, 25.1, 13.4, 19.7, 30.2, 15.6])
new = np.array([10.4, 12.8, 9.7, 15.1, 11.2, 8.9, 13.9, 17.3, 10.9, 12.1, 20.6, 9.3])

def desc(x):
    q1, q3 = np.percentile(x, [25, 75])   # same definition as R's default quantile()
    return {"n": len(x), "Mdn": np.median(x), "IQR": q3 - q1}

print(pd.DataFrame({"old": desc(old), "new": desc(new)}).T.round(2))

mw = stats.mannwhitneyu(old, new, method="exact")   # exact p-value (no ties, small n)
n1, n2 = len(old), len(new); N = n1 + n2
U_old = mw.statistic                                 # U for 'old'
z = (U_old - n1 * n2 / 2) / np.sqrt(n1 * n2 * (N + 1) / 12)  # normal approximation
print({"U_old": float(U_old), "U_new": float(n1 * n2 - U_old), "z": round(float(z), 3),
       "p_exact": round(float(mw.pvalue), 3), "r": round(float(abs(z) / np.sqrt(N)), 3),
       "rank_biserial": round(float(2 * U_old / (n1 * n2) - 1), 3)})

# Three groups: quiz scores (0-20) after three teaching formats
scores = {"lecture": [12, 15, 9, 14, 11, 17, 13, 10],
          "seminar": [8, 6, 11, 7, 9, 5, 10, 8],
          "online":  [13, 16, 12, 18, 14, 11, 19, 15]}
print(pd.DataFrame({k: desc(v) for k, v in scores.items()}).T.round(2))

H, p = stats.kruskal(*scores.values())               # H is corrected for ties
n = sum(len(v) for v in scores.values())
print({"H": round(float(H), 4), "df": len(scores) - 1, "p": round(float(p), 4),
       "epsilon_sq": round(float(H / (n - 1)), 4)})         # = H / ((n^2 - 1) / (n + 1))

# Dunn's post hoc test (tie-corrected) with Holm's adjustment
y = np.concatenate(list(scores.values()))
g = np.repeat(list(scores), [len(v) for v in scores.values()])
rk = stats.rankdata(y)
mean_rank = {k: rk[g == k].mean() for k in scores}
_, t = np.unique(y, return_counts=True)
tie_adj = np.sum(t**3 - t) / (12 * (n - 1))
rows = []
for a, b in combinations(scores, 2):
    se = np.sqrt((n * (n + 1) / 12 - tie_adj) * (1 / len(scores[a]) + 1 / len(scores[b])))
    zd = (mean_rank[a] - mean_rank[b]) / se
    rows.append({"pair": f"{a} vs {b}", "z": round(zd, 2), "p_raw": 2 * stats.norm.sf(abs(zd))})
res = pd.DataFrame(rows)
order = np.argsort(res["p_raw"].values)                # Holm step-down adjustment
adj = np.minimum(1, np.maximum.accumulate(res["p_raw"].values[order] * (len(res) - np.arange(len(res)))))
res.loc[order, "p_holm"] = adj
print(res[["pair", "z", "p_holm"]].round(4))
print({k: round(float(v), 2) for k, v in mean_rank.items()})

Two practical notes. R's wilcox.test() and SciPy's mannwhitneyu() report U for the first group you give them, so swap the order and you get 19 instead of 101. And with ties, R cannot compute an exact p value and falls back on the normal approximation with a continuity correction, so the p value will not match a hand-computed z exactly.

Setting out the results in a table

With three or more groups, or several outcomes, a table is easier to read than a long sentence. A simple layout for the Kruskal-Wallis example:

Do not repeat every number from the table in the text; the text should state the main finding and point to the table. For other designs, the test chooser suggests a test, and the DASS blog has more guides on reporting.

How to report Mann-Whitney and Kruskal-Wallis tests in APA style (7th edition)

Using the example above (italicize U, z, H, p, r, n and Mdn; Greek letters such as ε stay upright; no leading zero for p, r and ε², which cannot exceed 1):

"Task completion times were longer with the old design (Mdn = 17.65 min, IQR = 7.17, n = 10) than with the new design (Mdn = 11.65 min, IQR = 3.97, n = 12), Mann-Whitney U = 19, z = 2.70, exact p = .006, r = .58."

"Quiz scores differed across the three teaching formats, Kruskal-Wallis H(2) = 14.32, p < .001, ε² = .62. Dunn's tests with Holm's adjustment showed that the seminar group (Mdn = 8.0) scored lower than both the lecture group (Mdn = 12.5), z = 2.59, p = .019, and the online group (Mdn = 14.5), z = 3.69, p < .001, whereas the lecture and online groups did not differ, z = 1.10, p = .272."

The z values are given without their sign, with the direction stated in words; U = 19 is the smaller of the two U values. Report p values below .001 as p < .001, as here. In the method section, name both tests, say whether p values are exact or approximate, and name the effect sizes and the post hoc adjustment.

Related tools and guides

More answered questions

Working with your own data?

General answers only go so far. Send us your situation and we'll reply by email within two business days.

Ask your question

Need more than an answer?

Drafted with AI assistance and reviewed by Nedim Yel, PhD, research methodologist at DASS. This is general information, not advice for your specific data or study. When the results matter, check your approach with a qualified statistician.