4.4 - Wilcoxon signed-rank tests

4.4 - Wilcoxon signed-rank tests

A sign records which side of a median an observation lies on; a signed rank also records its relative distance from that median. Learn why symmetry makes this extra information usable, how to calculate signed ranks, and how to carry out a one-sample Wilcoxon test using the supplied tables.

Why symmetry matters

Can two samples with the same number of positive signs give different evidence about a population median? Yes: the larger deviations might all lie on one side.

Suppose the deviations from a proposed median are −1,−2,3,4-1,-2,3,4. There are two signs of each kind, but the positive deviations are larger. Ranking absolute deviations gives the ranks 1,2,3,41,2,3,4. The positive ranks sum to 77, while the negative ranks sum to 33.

Signed-rank information

The Wilcoxon signed-rank test uses the signs and the ranks of absolute deviations from a proposed population median. It requires an underlying continuous population distribution symmetric about its median, with independent observations.

Symmetry is the reason for the null probability model. Under the null median, a deviation of any given absolute size is equally likely to be positive or negative. With independent observations and no tied absolute deviations, every allocation of signs to the ranks is equally likely. An asymmetric population may give large deviations mainly on one side even when its median is correct; the usual signed-rank probabilities would then be inappropriate.

Worked example 1: equal sign counts, unequal rank sums

Question. For deviations −1,−2,3,4-1,-2,3,4, compare the information used by a sign test and a signed-rank test.

Plan. Count signs first, then attach signs to the ranks of the absolute deviations.

The sign count is 22 positive and 22 negative. The signed ranks are −1,−2,3,4-1,-2,3,4, so

P=3+4=7,Q=1+2=3.P=3+4=7,\qquad Q=1+2=3.

The sign counts are balanced; the rank sums show that the larger deviations are positive. A signed-rank test can use that additional pattern if population symmetry is justified.

Answer. The sign test retains only the 2:22:2 count; the signed-rank test also distinguishes the rank sums 77 and 33.

Check. The available ranks sum to 1+2+3+4=101+2+3+4=10, and P+Q=7+3=10P+Q=7+3=10.

Reverse the signs while preserving their counts. The extra information should reverse direction.

Worked example 2: reversing the larger deviations

Question. Compare the information for deviations 1,2,−3,−41,2,-3,-4.

Plan. Retain the absolute ranks and reassign their signs.

There are still two positive and two negative signs. Now

P=1+2=3,Q=3+4=7.P=1+2=3,\qquad Q=3+4=7.

The larger deviations are negative, so the signed-rank information points in the opposite direction even though the sign counts have not changed.

Answer. A sign test treats the two patterns alike; a signed-rank test distinguishes which side has the larger ranks.

Check. Negating every deviation exchanges the positive and negative rank sums. The new pair (3,7)(3,7) is the old pair (7,3)(7,3) in reverse order.

A visibly uneven small sample does not itself disprove population symmetry; samples vary. The assumption concerns the distribution from which it was sampled.

Watch out

“The data are symmetrical” does not state the required assumption. State that the population distribution is symmetric about its median. The sign test does not require this extra symmetry assumption.

Choose the assumption needed for the underlying probability calculation.

Signed ranks

Rank the distances from the proposed median, starting with rank 11 for the smallest distance, then restore each deviation's sign.

Use di=xi−m0d_i=x_i-m_0. Rank ∣di∣|d_i|, not did_i and not the raw observations. A large negative deviation gets a large absolute rank. Here there are no observations equal to the tested median and no tied absolute deviations, so the ranks are exactly 1,2,…,n1,2,\ldots,n.

Positive and negative rank sums

Let PP be the sum of ranks attached to positive deviations and QQ the sum of ranks attached to negative deviations, both recorded as nonnegative sums. Then

P+Q=n(n+1)2,T=min⁡(P,Q).P+Q=\frac{n(n+1)}2,\qquad T=\min(P,Q).

The definitions of P,Q,TP,Q,T are in the formula booklet. The total follows from adding the ranks 11 through nn.

Writing a negative signed rank is a useful intermediate step. The corresponding contribution to QQ is its positive magnitude.

Worked example 3: ranking absolute deviations

Question. The deviations from a proposed median are −0.8,1.6,−0.3,2.1,1.1,−1.9-0.8,1.6,-0.3,2.1,1.1,-1.9. Find P,Q,TP,Q,T.

Plan. Sort their absolute values, then return the ranks to their original positions.

The increasing absolute values are 0.3,0.8,1.1,1.6,1.9,2.10.3,0.8,1.1,1.6,1.9,2.1. Hence

Deviation−0.8-0.81.61.6−0.3-0.32.12.11.11.1−1.9-1.9
Signed rank−2-244−1-16633−5-5

Therefore P=4+6+3=13P=4+6+3=13 and Q=2+1+5=8Q=2+1+5=8.

Answer. P=13, Q=8, T=8P=13,\ Q=8,\ T=8.

Check. P+Q=21=6(7)/2P+Q=21=6(7)/2. Also the three positive deviations occupy ranks 3,4,63,4,6, giving 1313 directly from the sorted list.

Now change only the direction in which the deviations were defined.

Continue this lesson.

You’re previewing NovaLearn without an account. Create a free account to read the rest.

Create free account