Am 10.06.2016 um 13:59 schrieb Sven Schreiber:
 Am 09.06.2016 um 17:36 schrieb Sven Schreiber:
 
>
> I'd be happy about feedback regarding cross-checks and correctness (for
> example in the above document in equ. (4) the case S>0 wrongly appears
> twice, and I had to make an educated guess where to switch the
> signs...), whether it should become a function package and so on.
>
 
 A first cross-check with the 'trend' package from R and invoking the 
 test with "mk.test(M)" gives me the same result at least at face value 
 (up to the printed precision). 
... ping ... asking for feedback.
For your convenience I'm re-attaching the same code since you may not 
have your email archive ready.
Such a code snippet might also be posted as a reply (or comment) to this 
question on stackexchange: 
https://stats.stackexchange.com/questions/108649/mann-kendall-test-stata
It would be embarassing if it were wrong, so please do check if you have 
the time.
thanks,
sven