Significant Mann-Kendall trend but Sen slope = 0? I used the Mann Kendall trend test to determine the significance of the trends of the following time series data (sheet 1) and obtained a significant trend at 10% significance level for the month of April (autocorrelated) however, the Sen slope I obtained was zero. Similar results were obtained for other time series as well with a significance level set at 5%. I did the computations on R (modifiedmk package and trend package) as well as in XLSTAT (see sheet 2). XLSTAT was unable to compute the confidence intervals for the Sen slope for all the monthly data (Jan-Dec). I posted this question on various forums and the only seemingly logical explanation I received was on ResearchGate. But I am still unconvinced as I have not seen such a result in any of the papers that I have read on this topic. Can somebody please explain what's wrong here?
 A: The Mann-Kendall test is based on the signs of the differences in values whereas the Sen's slope estimate is the median of all the two-point slopes.
Sen's slope can be viewed as a weighted median of the differences in values, because the slope between two points $(t_i,x_i)$ and $(t_j,x_j)$ (with $t_i\ne t_j$) with values $x_i$ and $x_j$ is the difference $x_j-x_i$ weighted (multiplied by) the reciprocal distance $1/(t_j-t_i).$  This combination of the loss of quantitative information (MK) and weighting (Sen) can cause the two estimates, as well as associated tests of them, to be completely different.
How might we produce an example?  One way to produce a zero Sen slope is to assure that more than half the two-point slopes are zero. Here is one of the simplest possible illustrations.  It begins with a short upward trending segment.  Counterbalancing that is a long level segment at a lower value.  (How long? This segment of eight points contributes $\binom{8}{2}=28$ zero slopes out of all $\binom{8+3}{2}=55$ slopes, making the (bare) majority of slopes equal to zero.)
Nevertheless, there are enough points for MK to conclude the slope is significantly negative.  There are, after all, only three pairs of points exhibiting upward trends (the three pairs within the first three observations) while there are $3\times 8 = 24$ pairs exhibiting downward trends, for a net sign difference of $3-24 = -21$ (this is the MK statistic).  Since this overwhelming majority of points are in the downwards direction, MK is justified in concluding a negative trend exists.

To see the Mann-Kendall statistic, visualize lines between all points:

Of the $24+28+3 = 55$ distinct pairs, $24$ move down (from left to right) and only $3$ move up.  This difference is unlikely to occur by chance when the points are randomly resorted.
To see the Sen slope, redraw all these lines emanating from a common point and choose the middle:

This figure had to randomly alter ("jitter") the slopes to resolve the many zero slopes.  More than half are exactly zero (level), placing their median (middle) value in the horizontal position.
This helps us appreciate the difference in the two methods: the Sen's slope does not account for the many large downward slopes.  The Mann-Kendall statistic finds there are many more downslopes than upslopes, ignoring the horizontal slopes altogether.
Comment
One common use of these procedures is with environmental monitoring data, as popularized by Richard Gilbert in the 1980's.  Their attractiveness lies in their applicability to left-censored data: that is, nondetects aka "less-than" values.  In these tests, any value reported as "less than $x$" is treated as equal to another such value, but less than any value reported as $y$ with $y\ge x.$
A typical monitoring dataset in a condition that first got worse (environmental contamination), was rectified, and improved to the point of being unable to detect the contaminant, would look substantially like the figure (where the red dots are the nondetects and have been plotted at a constant value lower than all the gray quantified observations).  Thus, this situation is not a mere mathematical pathology or artificial construction: these circumstances actually exist--and with sufficiently long monitoring after the cleanup, can be expected to exist.
