4.4 - The Wilcoxon rank-sum test

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 H0H_0, 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 77 and 99 need not be equal. A rank-sum test can pool all 1616 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 11 to the total sample size, and retain each observation's group label.

Write the sample sizes as m≤nm\le n, and let RmR_m be the sum of the ranks in the sample of size mm. 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 1,2,…,m+n1,2,\ldots,m+n, the supplied table defines

W=min⁡(Rm, m(m+n+1)−Rm).W=\min\bigl(R_m,\ m(m+n+1)-R_m\bigr).

The reflected sum m(m+n+1)−Rmm(m+n+1)-R_m is obtained by reversing every rank. It is generally not the other sample's rank sum.

The definitions of RmR_m and WW are in the formula booklet.

Reversing ranks changes each rr to m+n+1−rm+n+1-r. Summing that expression over mm observations explains the reflected sum. The actual other sample's sum instead uses the total (m+n)(m+n+1)/2(m+n)(m+n+1)/2.

Worked example 3: pooling two samples

Question. Sample A contains 2.4,3.2,4.8,6.12.4,3.2,4.8,6.1; sample B contains 1.5,2.8,4.0,5.6,7.01.5,2.8,4.0,5.6,7.0. Find RmR_m and WW.

Plan. Use A as the sample of size m=4m=4, and rank the nine pooled observations.

Value1.51.52.42.42.82.83.23.24.04.04.84.85.65.66.16.17.07.0
SampleBABABABAB
Rank112233445566778899

Thus

Rm=2+4+6+8=20,4(10)−Rm=20.R_m=2+4+6+8=20,\qquad 4(10)-R_m=20.

Answer. Rm=20R_m=20 and W=20W=20.

Check. B's ranks sum to 1+3+5+7+9=251+3+5+7+9=25, so the two actual sums total 45=9(10)/245=9(10)/2. B's sum 2525 differs from the reflected sum 2020.

Replace only A's largest value, 6.16.1, by 0.90.9. 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