Can I use Wilcoxon Signed-Rank Test to test pairs of data in a time series? I have a dataset of measurements (non-normally distributed).
Each line of this dataset is composed of two measurements of the same variable at a specific time (i.e. XYY [time, meas1, meas2]). This dataset contains 24 lines.
Is it correct to use the Wilcoxon Signed-Rank Test to compare these two measurements? Is it correct to use this test to compare the mean value of these measurements between different experiments?
Thanks
 A: One major concern is whether there's serial dependence in the differences, due to the observations being over time. The test assumes independence and if that doesn't hold, it could be badly affected. [The rest of my answer is predicated on independence being sufficiently close to true that the null distribution of the test statistic is not badly affected.]
If you want to test the null hypothesis that the pairs of measurements have the same distribution against the alternative that they don't, the Wilcoxon signed rank test will be suitable (there are some other pairs of hypotheses that would fit with the test).
If you want to specifically test for an alternative of a difference in means, the test will be sensitive to that difference (under a null of identical distributions), but the location-shift estimate it gives is not a shift in means (it's the Hodges-Lehmann estimate, the median of pairwise differences; if you like it's the median shift). If your alternative is explicitly a shift alternative, the Hodges-Lehmann estimate will be a reasonable estimator for the population mean of the pairwise shifts.
(In short, if I understand your description, then yes, it looks like a signed rank test would be suitable, but to make your inference about the means you have to make additional assumptions.)
If your interest is particularly in the mean of the differences, I'd suggest looking at a permutation test; with a reasonably efficient implementation, your sample is small enough to cover all possible permutations.
A: I have also been wondering about this.  It turns out that this question has cropped up a few times in the recent past:


*

*Is Wilcoxon Signed-Rank Test the right test to use?

*Can I use wilcoxon signed rank test for time series data
@Glen_b makes the point that autocorrelation in the data (e.g. the tendency for readings close in time to be close in value) breaks the central assumption of the Wilcoxon Signed-Rank Test that the pairs are independent in your data.
Put another way, if your 100 paired readings are highly correlated over time (as is often the case), then you are not testing 100 independent pairs.  Your effective sample size is much smaller. If observation A >> observation B at time 1, the same is likely to be true at time 2, time 3 and so on... depending on the level of autocorrelation in the data.
Now Wilcoxon comes along and sees 100 independent samples that all have the property A >> B.  Bingo! A differs from B with dramatically high statistical significance.  But in reality, if you were to run the test again you might find that $A \approx B$ at time 1 and this propagates forwards in time as before. Wilcoxon now says that A and B have the same distribution.
So, having laboured this point, I now admit that I have no real idea how to deal with it!  A recent study gives a modification to the test to deal with clustered data.  For example a left eye - right eye (before and after) test. But our problem only has one 'cluster' - a single time series - so I don't think this will help.
