Why Signed-Rank Construction Matters
A paired comparison can contain both the direction and the size of each change. The sign records whether a measurement increased or decreased, while the rank of its absolute value records how large that change is relative to the others. The signed-rank construction combines these two pieces of information in a disciplined way.
The calculation is easy to disrupt by ranking signed values instead of absolute values, keeping a zero difference in the ranking, or assigning tied observations consecutive ranks without averaging. This tutorial focuses on constructing the ranks and their positive and negative sums. It does not address the assumptions or inferential procedures for a signed-rank test.
A Reliable Construction Procedure
Keep the original signs attached to the observations, but set them aside temporarily while ranking the magnitudes. A zero difference has neither a positive nor a negative sign and, under the conventional construction here, receives no rank. Thus, zeros do not contribute to \(m\), either rank sum, or the total rank.
State how each paired difference is formed, or what reference value is subtracted in a one-sample problem. This fixes the meaning of positive and negative.
Omit zero differences and set \(m\) equal to the number of nonzero differences.
Order the remaining \(|D_j|\) values from smallest to largest. For a tie occupying several rank positions, give each tied value the average of those positions.
Add the ranks attached to positive differences to obtain \(W^+\); add the ranks attached to negative differences to obtain \(W^-\).
Confirm that \(W^++W^-=m(m+1)/2\), the sum of the ranks from 1 through \(m\).
Why Average Ranks Preserve the Total
Suppose \(r\) observations share a tied magnitude and occupy the rank positions \(k,k+1,\ldots,k+r-1\). Each receives the average of those positions. The total assigned to the tied observations therefore equals the sum of the positions they replace:
Thus averaging tied ranks redistributes the ranks among tied observations without changing their combined contribution. Across all \(m\) nonzero observations, the assigned ranks still sum to \(1+2+\cdots+m=m(m+1)/2\). Since every nonzero observation is either positive or negative, this gives the check \(W^++W^-=m(m+1)/2\).
Worked Example: A Zero and Two Tied Magnitudes
A hypothetical paired review records changes \(D=\text{second measurement}-\text{first measurement}\), in units: \(+6,-2,0,+2,-5,+6,-1\). Construct the signed ranks and calculate both rank sums.
Method. Omit the zero, rank the remaining absolute differences, then use the original signs to calculate \(W^+\) and \(W^-\). The zero is not a ranked observation, so \(m=6\).
The nonzero absolute differences are \(6,2,2,5,6,1\). In increasing order they are \(1,2,2,5,6,6\). The magnitude 1 has rank 1. The two magnitudes 2 occupy positions 2 and 3, so each receives \((2+3)/2=2.5\). The magnitude 5 has rank 4. The two magnitudes 6 occupy positions 5 and 6, so each receives \((5+6)/2=5.5\).
The positive differences are \(+6,+2,+6\), with ranks \(5.5,2.5,5.5\). Therefore \(W^+=5.5+2.5+5.5=13.5\). The negative differences are \(-2,-5,-1\), with ranks \(2.5,4,1\). Therefore \(W^-=2.5+4+1=7.5\).
Check: \(W^++W^-=13.5+7.5=21\), and \(m(m+1)/2=6(7)/2=21\). The totals agree. Common mistake avoided: the zero is not assigned a rank, and each tied magnitude receives an average rank rather than a separate integer rank.
Keep Signs Separate From Magnitude Ranks
The rank is determined by the absolute difference alone. For example, a difference of \(-4\) and one of \(+4\) have the same magnitude and therefore receive the same rank if they are tied at that magnitude. Their signs determine which sum receives that rank; the signs do not change the ranking order.
A compact working table helps prevent sign and arithmetic errors. Record the original difference, its absolute value, its rank, and the signed rank before summing. When several observations tie, show the rank positions used to calculate their shared average.
Worked Example: Constructing Ranks From Paired Measurements
A hypothetical service team compares completion times before and after a process change. For seven tasks, define \(D=\text{after time}-\text{before time}\), in minutes. The paired times (before, after) are \((20,24),(15,14),(18,18),(22,26),(10,8),(30,31),(25,20)\). Find \(m\), the ranks, \(W^+\), and \(W^-\).
Method. Calculate each difference in the stated order before ranking. The differences are \(+4,-1,0,+4,-2,+1,-5\). There is one zero, so \(m=6\).
The nonzero absolute differences are \(4,1,4,2,1,5\), which in order are \(1,1,2,4,4,5\). The two magnitudes 1 occupy ranks 1 and 2, so each receives rank \((1+2)/2=1.5\). The magnitude 2 receives rank 3. The two magnitudes 4 occupy ranks 4 and 5, so each receives rank \((4+5)/2=4.5\). The magnitude 5 receives rank 6.
The positive differences \(+4,+4,+1\) have ranks \(4.5,4.5,1.5\), giving \(W^+=4.5+4.5+1.5=10.5\). The negative differences \(-1,-2,-5\) have ranks \(1.5,3,6\), giving \(W^-=1.5+3+6=10.5\).
Check: The sums total \(21\), equal to \(6(7)/2=21\). The differences also agree with the listed pairs; for example, the first is \(24-20=+4\), while the fifth is \(8-10=-2\). Common mistake avoided: reversing the subtraction would reverse the signs and swap the two rank sums, so the difference convention must be applied consistently.
A Larger Tie Block and a Full Arithmetic Check
When there are several tie blocks, check each block separately. Its average rank may be fractional, but multiplying that rank by the number of observations in the block must reproduce the sum of the occupied rank positions. The overall total-rank check then tests the whole calculation.
Worked Example: Three Tied Magnitude Groups
A hypothetical audit records signed deviations, in days, from a target: \(-9,+3,+6,0,-3,+9,-6,+12,-3\). Construct the signed ranks and find \(W^+\) and \(W^-\).
Method. Omit the zero, leaving \(m=8\) nonzero deviations. The absolute values are \(9,3,6,3,9,6,12,3\), ordered as \(3,3,3,6,6,9,9,12\).
The three magnitudes 3 occupy ranks 1, 2, and 3, so each receives rank \((1+2+3)/3=2\). The two magnitudes 6 occupy ranks 4 and 5, so each receives rank \((4+5)/2=4.5\). The two magnitudes 9 occupy ranks 6 and 7, so each receives rank \((6+7)/2=6.5\). The magnitude 12 receives rank 8.
Positive deviations \(+3,+6,+9,+12\) have ranks \(2,4.5,6.5,8\), so \(W^+=2+4.5+6.5+8=21\). Negative deviations \(-9,-3,-6,-3\) have ranks \(6.5,2,4.5,2\), so \(W^-=6.5+2+4.5+2=15\).
Check: \(21+15=36\), and \(8(9)/2=36\). Within the rank-3 tie block, the assigned total is \(3(2)=6=1+2+3\), as required. Common mistake avoided: the three observations of magnitude 3 all receive rank 2; they do not receive ranks 1, 2, and 3 individually.
Common Construction Errors
- Ranking the signed differences. Rank \(|D_j|\), not \(D_j\). The sign is used afterward to decide whether the rank enters \(W^+\) or \(W^-\).
- Including zeros in the rank sequence. Under the conventional construction used here, omit zero differences before counting \(m\) and assigning ranks.
- Breaking ties arbitrarily. A tied group occupying positions \(k\) through \(k+r-1\) receives the average of those positions for every member.
- Using the total number of pairs in the check. The check uses \(m\), the number of nonzero differences, not the original number of pairs.
- Subtracting in an unstated direction. Reversing the order of paired measurements reverses every nonzero sign and interchanges the two sums. State the convention first.
These checks catch construction errors, but they do not establish that a particular inferential procedure is appropriate. Questions about the conditions for signed-rank inference are separate from the mechanical ranking step.
Check Your Understanding
For each problem, construct ranks from the nonzero absolute differences and check the rank-sum total.
- For differences \(+2,-2,0,+5,-1\), find \(m\), \(W^+\), and \(W^-\). (Answer: \(m=4,\ W^+=6.5,\ W^-=3.5\); total \(10=4(5)/2\).)
- For differences \(+7,-3,+3,0,-7,+1\), find the average rank for each distinct magnitude and both sums. (Answer: \(m=5\); magnitudes 1, 3, and 7 have ranks 1, 2.5, and 4.5, respectively; \(W^+=8,\ W^-=7\); total \(15=5(6)/2\).)
- For differences \(-4,+2,+4,+8,-2,0,+2,-8\), calculate \(W^+\) and \(W^-\), showing the tied ranks. (Answer: \(m=7\); magnitudes 2, 4, and 8 have ranks 2, 4.5, and 6.5, respectively; \(W^+=15,\ W^-=13\); total \(28=7(8)/2\).)
- For differences \(+1,-5,+5,-2,+8,0,-8,+2\), find \(m\), \(W^+\), and \(W^-\). (Answer: \(m=7\); magnitudes 1, 2, 5, and 8 have ranks 1, 2.5, 4.5, and 6.5, respectively; \(W^+=14.5,\ W^-=13.5\); total \(28=7(8)/2\).)
- For differences \(0,0,+3,-3,+6\), find the number ranked and both rank sums. (Answer: \(m=3\); magnitudes 3 and 6 have ranks 1.5 and 3, respectively; \(W^+=3,\ W^-=1.5\); total \(4.5=3(4)/2\).)