# Is it appropriate to use ranksum to compare statistical means for time series data?

3 views (last 30 days)
waterdata on 20 Dec 2021
Answered: Jeff Miller on 20 Dec 2021
Hi everyone,
I recently recieved a paper back from peer review, with a comment from both reviewers that it is not appropriate to use the Wilcoxon Rank Sum test (Matlab built-in: ranksum) to test time series data. They both suggested the Mann-Kendall test, which does not accomplish the same goal--I'm curious to see if the means of two time series are statistically significantly different. These time series are daily model output from a climate model.
I'm confused because I thought that using ranksum in this context was appropriate--there is an example in the Mathworks documentation for ranksum that compares the means of two time series.

Star Strider on 20 Dec 2021
I have a textbook that discusses it briefly, and it appears to be a subset of the rank-sum test, with a different calculation of the statistic. Apparently, the reviewers want to test for trends.
There are several options in the File Exchange, and this search on the Mann-Kendall Test brings up a number of related contributions.
.

Jeff Miller on 20 Dec 2021
The ranksum test ignores the sequential order of scores, so for example ranksum(x,y) will give you the same answer no matter how you randomly permute the orders of the scores within x and y. This essentially means that the test ignores any systematic temporal fluctuations (e.g., seasonal) that might affect both x and y similarly. The reviewers might be objecting to ranksum on that basis, if some seasonal or similar factor might affect your x and y values similarly.
It's a little hard to say what test would be right without more specifics about your data and research question. If you have x and y measurements at exactly the same time points, you might start by seeing what % of time points have x>y, which is one way to control for systematic fluctuations due to time. If your x and y are measured at different time points, then it would be more complicated to remove seasonal effects.

R2021b

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by