Tutorials › Introduction to Statistics › Effect Sizes for Two-Sample Rank Tests

Nonparametric Alternatives · Tutorial 963 of 996

Effect Sizes for Two-Sample Rank Tests

Use pairwise comparisons to describe how often values from one independent group tend to exceed values from another, and distinguish that effect from a test’s p-value.

Intermediate 10 min read

What You'll Learn

  • Define common-language probability using pairwise comparisons between two independent samples.
  • Calculate Mann–Whitney \(U\) and rank-biserial correlation from pooled ranks.
  • Give tied comparisons half credit and interpret their effect on both measures.
  • Describe the direction and magnitude of a rank-based effect in context.
  • Explain why effect size and statistical significance answer different questions.

Why Measure the Size of a Rank-Based Effect?

A rank-sum test can assess whether two independent groups show evidence of a difference, but its p-value does not describe how large or practically important that difference is. Effect sizes help fill that gap. For two samples, one direct approach is to compare every value in one group with every value in the other. These comparisons lead to the common-language probability and rank-biserial correlation.

The measures describe relative ordering: how often an observation from one group exceeds an observation from the other. They do not measure a difference in the original units, and they do not by themselves establish that the groups differ in a particular feature such as their medians. The direction must be stated clearly, and the scientific meaning depends on the outcome being measured.

Definition: Let group A and group B be independent samples of sizes \(n_A\) and \(n_B\). Compare each of the \(n_A n_B\) cross-group pairs. The common-language probability for A over B is the proportion of pairs for which A is larger, counting a tie as one-half of a favorable comparison. It estimates the probability that a randomly selected observation from A exceeds a randomly selected observation from B, with ties split evenly. The rank-biserial correlation for A over B is the proportion of strict wins for A minus the proportion of strict wins for B, among all cross-group pairs. Its value ranges from \(-1\) to \(1\).

Here, “probability” is a sample-based estimate of a population comparison probability, not a claim that the observed data themselves are random after collection. The common-language estimate counts ties as half, so it can also be written as the number of A wins plus half the number of ties, divided by \(n_A n_B\). Rank-biserial correlation uses the same comparison counts, but expresses the balance of wins and losses on a scale centered at zero.

From Pairwise Comparisons to \(U\) and Rank-Biserial Correlation

For the calculations below, define \(U_A\) as the number of cross-group pairs in which A is larger, plus half the number of tied cross-group pairs. Thus, \(U_A\) ranges from 0 to \(n_A n_B\). This direction convention matters: switching A and B reverses the sign of rank-biserial correlation.

$$ \text{Common-language estimate for A over B} = \frac{U_A}{n_A n_B} $$
$$ r_{\mathrm{rb}} = \frac{U_A-U_B}{n_A n_B} = \frac{2U_A}{n_A n_B}-1 $$

Here, \(U_B\) is the corresponding count for B over A, again giving half credit to ties. Each cross-group pair contributes a total of one across \(U_A\) and \(U_B\): A wins contribute one to \(U_A\), B wins contribute one to \(U_B\), and a tie contributes one-half to each. Therefore \(U_A+U_B=n_A n_B\). This identity gives the second expression for rank-biserial correlation.

The measures can also be calculated from pooled ranks. Rank all observations together from smallest to largest, using average ranks for tied values. Let \(R_A\) be the sum of the ranks for group A. Then

$$ U_A = R_A-\frac{n_A(n_A+1)}{2} $$

This rank-sum formula gives the same \(U_A\) as the pairwise method, including when pooled ties are assigned average ranks. For a modest data set, pairwise comparisons make the meaning especially transparent; for larger data sets, the rank sum is usually more efficient to calculate.

Worked Calculations

Worked Example: Comparing Two Samples Without Ties

Suppose two hypothetical independent samples measure a quantity for which larger values are favorable. Group A has values 8, 10, and 12; group B has values 5, 9, and 11. Calculate the common-language estimate and rank-biserial correlation for A over B.

There are \(3\times3=9\) cross-group pairs. The value 8 in A exceeds only 5 in B, giving one win. The value 10 exceeds 5 and 9, giving two wins. The value 12 exceeds all three B values, giving three wins. Thus A has \(1+2+3=6\) wins, B has 3 wins, and there are no ties. Therefore \(U_A=6\).

$$ \text{Common-language estimate} = \frac{U_A}{n_A n_B} = \frac{6}{3\times3} = 0.6667 $$

In these samples, a randomly selected A value exceeds a randomly selected B value in 6 of 9 comparisons, or about 66.7% of cross-group pairs.

$$ r_{\mathrm{rb}} = \frac{2U_A}{n_A n_B}-1 = \frac{2(6)}{9}-1 = 0.3333 $$

The positive value indicates more A wins than B wins. Equivalently, the difference between the strict-win proportions is \((6-3)/9=0.3333\). The pooled ranks give the same result: their order is B: 5 (rank 1), A: 8 (rank 2), B: 9 (rank 3), A: 10 (rank 4), B: 11 (rank 5), A: 12 (rank 6). Hence \(R_A=2+4+6=12\), and \(U_A=12-3(4)/2=6\).

Worked Example: Giving Tied Comparisons Half Credit

Now suppose hypothetical values are A: 4, 6, 6 and B: 3, 6, 8. There are nine cross-group pairs. A strictly exceeds B in three pairs: each of the two A values of 6 exceeds B’s 3, and A’s 4 exceeds B’s 3. The two comparisons between an A value of 6 and B’s 6 are ties. Thus \(U_A=3+\frac{1}{2}(2)=4\).

$$ \text{Common-language estimate} = \frac{4}{9} = 0.4444 $$

Counting each tie as half, the sample estimate is 44.44% for A over B. The rank-biserial correlation is

$$ r_{\mathrm{rb}} = \frac{2(4)}{9}-1 = -\frac{1}{9} = -0.1111 $$

The negative sign indicates a slight balance of the pairwise comparisons in B’s favor. To check by ranks, the pooled values are 3 (rank 1), 4 (rank 2), the three tied values of 6 (average rank 4 each), and 8 (rank 6). The A rank sum is \(R_A=2+4+4=10\), so \(U_A=10-\frac{3(4)}{2}=4\). The tied ranks must be averaged; assigning the tied observations separate ranks would change the calculation incorrectly.

Worked Example: A Large Observed Effect Can Have a Non-Significant Test

Consider hypothetical samples with three observations each: A: 7, 8, 9 and B: 1, 2, 3. Every A value exceeds every B value, so \(U_A=9\), the maximum possible value. The sample common-language estimate is \(9/9=1.000\), and

$$ r_{\mathrm{rb}} = \frac{2(9)}{9}-1 = 1.000 $$

The observed ordering is completely in A’s favor. Nevertheless, with only three observations per group, an exact two-sided rank-sum test under the null of exchangeable group labels has \(20\) possible assignments of three of the six pooled ranks to A. Only the two completely separated assignments, \(U_A=0\) and \(U_A=9\), are at least as extreme as the observed result in either direction. Thus the exact two-sided p-value is \(2/20=0.100\). At a significance level of \(\alpha=0.05\), this test does not reject its null hypothesis.

The effect estimate describes the observed ordering, while the p-value describes how unusual a test statistic this extreme would be under the specified null model. A maximum sample effect does not guarantee a small p-value, particularly in a small study. Nor does a non-significant p-value show that the effect is zero. The size, design, and uncertainty of the study all matter when drawing a practical conclusion.

Why the Rank-Sum Formula Works

A short derivation connects the pooled ranks to the pairwise definition. Imagine first that all pooled observations have distinct values. For each observation in A, its rank is one plus the number of observations below it in the pooled ordering. Summing those ranks over A gives one for each A observation, plus contributions from other observations below A values. Of the latter contributions, the A observations account for \(0+1+\cdots+(n_A-1)=n_A(n_A-1)/2\). The remaining contributions count exactly the B observations below A observations: each such cross-group pair is an A win.

Consequently, \(R_A=n_A+n_A(n_A-1)/2+\text{number of A wins}\). The first two terms combine to \(n_A(n_A+1)/2\). Subtracting them gives the number of A wins, which proves the rank-sum formula when there are no ties. With ties assigned average ranks, each tied cross-group pair contributes half to the rank-based count; the same identity therefore gives the half-credit \(U_A\) used above.

Interpreting Magnitude and Direction

The common-language estimate is often easiest to explain in words: “An observation selected from A exceeds one selected from B in an estimated \(q\) of cross-group comparisons, counting ties as half.” Rank-biserial correlation is a signed balance: \(1\) means every cross-group pair favors A; \(-1\) means every pair favors B; and \(0\) means the strict-win proportions are equal. A value of zero does not necessarily mean the two distributions are identical; different distribution shapes can produce a balanced count of wins and losses.

These measures summarize relative ordering, not the size of the gaps. If every A value exceeds its paired comparison by a tiny amount, the common-language estimate can still be 1. The measures also do not have universal cutoffs that determine whether an effect is “small,” “moderate,” or “large.” Practical importance depends on the outcome, the consequences of a difference, and the study context. When reporting a result, state which group is being compared as larger, give the measure and its numerical value, and explain what that ordering means in the outcome’s context.

The comparison probability does not, without further assumptions, mean that one group has a higher median. It is an across-distribution probability statement: a random draw from one target population is more likely to exceed a random draw from the other. The groups may differ in spread or shape as well as location, so do not translate a rank-based effect automatically into a simple shift in typical values.

Conditions, Reporting, and Common Pitfalls

For a meaningful two-sample interpretation, the observations should come from two independent groups, and each recorded value should be comparable on the same ordered outcome scale. If the goal is to generalize beyond the observed samples, the sampling or study design must support that generalization. The effect-size arithmetic itself does not require normally distributed outcomes. If the samples are paired or measurements are repeated on the same individuals, the independent-sample pair counting described here is not appropriate.

A report should identify the direction convention, the sample sizes, the effect estimate, and the outcome context. For example: “Among the hypothetical measurements, an A observation exceeded a B observation in 66.7% of cross-group comparisons; the rank-biserial correlation for A over B was 0.333.” If a test is also reported, present its p-value separately and do not treat it as a measure of effect magnitude.

  • Wrong: “The p-value is the probability that there is no difference.” Correction: A p-value is calculated under a specified null model; it is not the probability that the null hypothesis is true.
  • Wrong: “A positive rank-biserial correlation proves A has the higher median.” Correction: It indicates a balance of pairwise comparisons favoring A; it does not by itself establish a median difference.
  • Wrong: “A common-language estimate of 0.70 means the A values are 70% larger.” Correction: It means 70% of cross-group comparisons favor A, counting ties as half, not that values differ by 70% in size.
  • Wrong: “The effect is unimportant because the test was not significant.” Correction: Statistical significance and practical magnitude are different questions. Consider the effect estimate, study size, uncertainty, and context together.
Key takeaway: For independent samples, \(U_A/(n_A n_B)\) is the half-tie-adjusted common-language estimate for A over B, and \(2U_A/(n_A n_B)-1\) is rank-biserial correlation. Both describe relative ordering; neither replaces a p-value or a contextual judgment of practical importance.

Check Your Understanding

Answer each question using the direction “A over B” where relevant.

  1. If \(n_A=4\), \(n_B=5\), and \(U_A=15\), calculate the common-language estimate and rank-biserial correlation.
  2. There are 12 cross-group pairs, with 5 strict A wins and 4 tied pairs. What is \(U_A\), and what proportion is the common-language estimate?
  3. What does a rank-biserial correlation of zero say about strict wins and losses? Why does it not prove that the two distributions are identical?
  4. Can a sample have a common-language estimate of 1.00 and a two-sided test p-value above 0.05? Explain using sample size.
  5. Why is it misleading to describe a common-language estimate of 0.65 as saying that A values are 65% larger than B values?