For two independent samples of sizes , rank their pooled observations and let be the sum of the ranks of the first sample. With continuous observations, the null hypothesis of a common distribution makes every allocation of ranks to that sample equally probable. A one-sided alternative that the first sample is stochastically smaller rejects for small , equivalently small . In a common-shape location model this tests a negative location difference. Without the common-shape assumption it is not simply a test of medians. The shifted statistic counts cross-sample pairs for which the first observation exceeds the second. Ties use average ranks and a conditional permutation test or a tie-adjusted normal approximation.
With and no ties, sampling ranks without replacement gives the displayed mean and variance. For observed rank sum below its mean, a continuity-corrected lower-tail statistic is . Ties of sizes replace the variance by . These formulas concern the raw rank sum; the Mann–Whitney U test statistic subtracts from both the observation and its mean.
Under the continuous common-distribution null of the Wilcoxon rank sum test, pooled labels are exchangeable. The product records every choice of ranks: choosing assigns rank to the first sample. Its indicated coefficient counts subsets of size and rank sum . Divide by and sum the lower tail for the one-sided P-value. Equivalently the counts satisfy with , allowing an exact integer computation.
For two independent continuous samples of positive sizes under a common-distribution null, each -subset of ranks is equally likely. The smallest rank sum is , attained only by . The only subset with rank sum one larger is . Hence the exact lower tail at that threshold is . This follows directly by observing that any other change increases the sum by at least two.
Articles by others on the same topic
There are currently no matching articles.