Consider our simple example:
Y X D 6 10 -4 13 15 -2 30 25 5 40 31 9
Thus the 4 differences are: -4, -2, 5, 9. Notice that the positive
numbers are slightly larger. So the edge is to the positive side; although
the test should be far from significant.
Our analysis is based on the one sample Wilcoxon test statistic. This is often referred to as the Signed-Rank Wilcoxon . So, let us label it the SRW procedure.
The SRW statistic is
ave. with -4 -2 5 9 ************************ -4 * -4 -3 .5 2.5 -2 * -2 1.5 3.5 5 * 5 7 9 * 9
Our SRW statistic is the number of positive averages in the table. Hence the test statistic is W = 7.
How many positive averages would you expect if H0 is true. Well half should be positive
and half should be negative. Since there are in general
where n is the number of differences, in this case we expect W to
.5*(4(5)/2) or 5. At 7, W is not far from what
you expect it to if the null hypothesis is true. Again we need a p-value
which we can get by resampling. (How would you do this resampling? It must
be under H0. We come back to this in a moment. Just assume
we can do it). This can be obtained using the class paired sample analysis code. Drop the differences -4, -2, 5, 9 into the data box. The test statistic and p-value are returned to you.
If you do this, you will get a p-value of about .37. You certainly
The point estimate of the effect, ,
is the median of
Looking back up at the table, you see the median is
.5(1.5+2.5) = 2.
A confidence interval is based on resampling the paired differences
-4,-2, 5, 9. The class paired sample analysis code will also return the point estimate and the confidence
interval. Try it. You should get 2 as the point estimate. My confidence
interval (based on 1000 resamples is (-4, 9), which contains 0 (hardly
a surprise here, right?).
How do we do the resampling for the p-value? H0 must be true; i.e., the true must be 0. Just take the differences (in this case -4, -2, 5, 9) and subtract off the point-estimate (in this case 2). This will center the differences for the Wilcoxon around 0. Our table for these "centered'' differences is:
ave. with -6 -4 3 7 ************************ -6 * -6 -5 -1.5 .5 -4 * -4 -.5 1.5 3 * 3 5 7 * 7The Wilcoxon test statistic here is 5, just what you expect under H0. The class code does this type of resampling for its p-value.