4.4 - The Wilcoxon rank-sum test
Two independent samples cannot be matched by subtracting the first entry in one list from the first in the other. Learn how to pool their ranks, calculate the Wilcoxon rank-sum statistic, and test for a difference between symmetric populations using the supplied table.
Two independent samples
How can you compare two populations when their sample sizes differ and there is no natural pairing? Rank all the observations together.
In a matched-pairs test, each difference has a reason: the same person, machine or matched unit supplies both measurements. For two independent samples, the observations in one sample are unrelated to those in the other. Pairing them in list order would create arbitrary differences whose values change if one list is rearranged.
Wilcoxon rank-sum design
The Wilcoxon rank-sum test compares two independent random samples by ranking their pooled observations and summing one sample's ranks.
For the method used here, require continuous populations symmetric about their medians, independent observations, and no tied pooled ranks. Under , the two population distributions are identical.
If the populations are identical, the sample labels are interchangeable among the pooled ranks. A sample whose values tend to be larger will instead tend to collect higher ranks. A directional interpretation as a difference in location uses an otherwise common-shaped symmetric population model; equal population medians alone do not state the full identical-distributions null.
Worked example 1: unequal independent groups
Question. Seven components are randomly selected from production line A and nine independently from line B. Each is measured once. Both continuous population distributions can be assumed symmetric. Identify an appropriate non-parametric design for comparing them.
Plan. Decide whether measurements have natural partners before selecting a rank method.
No A component is paired with a B component. The sample sizes and need not be equal. A rank-sum test can pool all measurements and compare the rank allocation under the null of identical populations.
Answer. Use an independent-samples Wilcoxon rank-sum test, provided the pooled observations have no ties.
Check. Reordering either sample leaves the pooled values and sample memberships unchanged, so it cannot change the rank-sum result.
Change only the sampling design. Two columns do not automatically mean two independent samples.
Worked example 2: a design that is paired
Question. Seven components are randomly selected, and each is measured by both instruments A and B. Which non-parametric design respects these data?
Plan. Identify the unit linking the two measurements.
Each component supplies an A measurement and a B measurement. They are paired by component, so calculate seven A-minus-B differences. Use a paired sign test, or a matched-pairs signed-rank test if the population differences satisfy its symmetry assumption.
Answer. Use a paired method; treating the fourteen measurements as independent would ignore the design.
Check. Permuting the B measurements among components would change the seven differences. That loss of the original matching confirms why the pair identifiers matter.
The rank-sum test and the signed-rank test have similar names but different inputs. The former ranks pooled observations; the latter ranks absolute deviations or paired differences.
Key idea
Choose from the sampling design first: independent samples give pooled ranks; matched units give within-pair differences.
Identify both the method and the population assumption in a new comparison.
Combined ranks
Pool both samples into one increasing list, assign ranks from to the total sample size, and retain each observation's group label.
Write the sample sizes as , and let be the sum of the ranks in the sample of size . If the sizes are equal, choose and label either sample consistently. Do not rank each sample separately: separate ranks would contain no information about how the populations compare.
The rank-sum table statistic
For pooled increasing ranks , the supplied table defines
The reflected sum is obtained by reversing every rank. It is generally not the other sample's rank sum.
The definitions of and are in the formula booklet.
Reversing ranks changes each to . Summing that expression over observations explains the reflected sum. The actual other sample's sum instead uses the total .
Worked example 3: pooling two samples
Question. Sample A contains ; sample B contains . Find and .
Plan. Use A as the sample of size , and rank the nine pooled observations.
| Value | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Sample | B | A | B | A | B | A | B | A | B |
| Rank |
Thus
Answer. and .
Check. B's ranks sum to , so the two actual sums total . B's sum differs from the reflected sum .
Replace only A's largest value, , by . It moves past several pooled observations, so several ranks must be updated.
Continue this lesson.
You’re previewing NovaLearn without an account. Create a free account to read the rest.
Create free account