You should use the signed rank test when the data are paired.
You'll find many definitions of pairing, but at heart the criterion is something that makes pairs of values at least somewhat positively dependent, while unpaired values are not dependent. Often the dependence-pairing occurs because they're observations on the same unit (repeated measures), but it doesn't have to be on the same unit, just in some way tending to be associated (while measuring the same kind of thing), to be considered as 'paired'.
You should use the rank-sum test when the data are not paired.
That's basically all there is to it.
Note that having the same $n$ doesn't mean the data are paired, and having different $n$ doesn't mean that there isn't pairing (it may be that a few pairs lost an observation for some reason). Pairing comes from consideration of what was sampled.
The effect of using a paired test when the data are paired is that it generally gives more power to detect the changes you're interested in. If the association leads to strong dependence*, then the gain in power may be substantial.
* specifically, but speaking somewhat loosely, if the effect size is large compared to the typical size of the pair-differences, but small compared to the typical size of the unpaired-differences, you may pick up the difference with a paired test at a quite small sample size but with an unpaired test only at a much larger sample size.
However, when the data are not paired, it may be (at least slightly) counterproductive to treat the data as paired. That said, the cost - in lost power - may in many circumstances be quite small - a power study I did in response to this question seems to suggest that on average the power loss in typical small-sample situations (say for n of the order of 10 to 30 in each sample, after adjusting for differences in significance level) may be surprisingly small.
[If you're somehow really uncertain whether the data are paired or not, the loss in treating unpaired data as paired is usually relatively minor, while the gains may be substantial if they are paired. This suggests if you really don't know, and have a way of figuring out what is paired with what assuming they were paired -- such as the values being in the same row in a table, it may in practice may make sense to act as if the data were paired to be safe -- though some people may tend to get quite exercised over you doing that.]
The expectation is that there will be dependence within pairs $(x_i,y_i)$, but this is not actually a requirement -- the test will work correctly whether this is true or not. The test is applied to the pair-differences $d_i =y_i-x_i$; if there's positive dependence, taking account of this pairing by taking differences is helpful in reducing variation.
There is assumed to be independence between those differences $d_i$ is independent of $d_j$. This is unlikely to be true of time series.
Continuous dependent variable – Although the Wilcoxon signed rank test ranks the differences according to their size and is therefore a non-parametric test, it assumes that the measurements are continuous
If they're not, the tabled distribution doesn't apply and the test will depend on the pattern of ties.
To account for the fact that in most cases the dependent variable is binomially distributed, a continuity correction is applied.
This makes no sense to me. How would a continuity correction deal with the problem? In large samples you could retain a normal approximation but use a variance that takes account of the pattern of ties, and in smaller samples you'd attempt to compute or simulate from the permutation distributon.
See also the discussion here
Some articles says that " the Paired differences should be Symmetrical".
The signed rank test is a permutation test on the signed ranks (the ranks of the absolute differences), so if we look at it in that way, then for the signs to be exchangeable under the null (in the sense that every rank would be as likely to have come from a positive as a negative difference), it would seem to require symmetry.
(If you don't have symmetry, then it's not generally the case that under the null you could legitimately reallocate the signs like that - for a given rank one sign would typically be more likely than the other.)
Best Answer
The Wilcoxon signed rank test is a nonparametric test for two populations when the observations are paired. Using the Wilcoxon signed rank test with two samples,
s1
ands2
will allow you to test for the null hypothesis thats1 – s2
comes from a distribution with zero median and density that is symmetric about that median (thanks @ttnphns for spotting this
). It is not concerned with averages (ie. means) at any point.My main concern would be that that the Wilcoxon signed rank test asks for each pair to be chosen randomly and independently. Your data appears to be part of a timeseries so I would suspect a seasonal component to come into play.
I do not think that the Wilcoxon signed rank test assumptions are fulfilled for your particular case. You might want to "bend the rules" and say that each pair is random and independent of the others (so you are OK to use the W.s.r. test) but this is your choice to make.