Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mann-Kendall trend test in STATA (Tutorials)

    Hello Everyone,

    I am trying to find out how to do a non-parametric Mann-Kendall trend test to detect monotonic trends.

    Here is some example data:

    Year variable values = 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
    Events variable values = 420, 350, 305, 288, 250, 209, 175, 89

    Thanks!

    -RRS

  • #2
    Hi Ramon Rodriguez-Santana. The Mann-Kendall trend test is based on the Kendall tau correlation between the outcome and the time variable, so you can use Stata's -ktau- command. Here are your data using -dataex- as recommended:


    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int(year events)
    2011 420
    2012 350
    2013 305
    2014 288
    2015 250
    2016 209
    2017 175
    2018  89
    end

    And here is the result of the test:

    Code:
    . ktau year events
    
      Number of obs =       8
    Kendall's tau-a =      -1.0000
    Kendall's tau-b =      -1.0000
    Kendall's score =     -28
        SE of score =       8.083
    
    Test of Ho: year and events are independent
         Prob > |z| =       0.0008  (continuity corrected)
    You have clear evidence of a negative trend over time. Results agree exactly with the MannKendall function in the R package Kendall.

    Comment


    • #3
      Hi German Rodriguez,

      Thanks for all the information... especially for the STATA Kendall tau correlation example.

      Sincerely,

      -RRS

      Comment

      Working...
      X