Announcement

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

  • What is the difference between “ranksum” and “ranksumex” in Stata?

    Hello everyone,

    I was told to run Mann-Whitney U test in Stata. Apparently, just found out Mann-Whitney U test is called Wilcoxon rank sum test in Stata instead of Mann-Whitney …
    Soon right after I ran ranksum in Stata, I then cross checked with my friend, who is a SPSS user and has exactly Mann-Whitney test (as it is called) in the software, we found that the p-value generated by SPSS and Stata ended up being different.

    I then found a blog site that has one discussion section in response to this problem, according the blogger himself, he also encountered the same problem of having different p-value generated by stata and R respectively. With regard to the issue of different p-values, the blogger suggested to use ranksumex instead of ranksum at the end of his article.
    http://www.senresearch.org/stata-and...es-differ.html

    After reading the entire article, I thought maybe it will be more appropriate to use “ranksumex” if my sample size appears to be less than 20, which is indeed in my case, but on the other hand, ranksum is only suitable to be used when your sample size is big enough.
    Not sure if my assumption is right or not…

    Or people just simply use “ranksum” as the standard synathax to run Wilcoxon rank sum test in stata despite of how big and small the sample size is?

    Many thanks for the clarification in advance.

  • #2
    Hello Emerald. I agree that you ought to use -ranksumex- for small samples. In the old days when computations were done by hand, and observed values were compared to critical values, tables of critical U values typically went up to n1=n2=20. If either sample size exceeded 20, people used the large sample z-test approximation. Unfortunately, -ranksumex- only returns exact p-values if n1+n2 < 26.

    From the help for -ranksumex-.

    Code:
        ranksumex tests the hypothesis that two independent samples (that is, unmatched data) are
        from populations with the same distribution by using the Wilcoxon ranksum test, which is also
        known as the Mann-Whitney two-sample statistic (Wilcoxon 1945; Mann and Whitney 1947).
        ranksumex will return exact p-values if the total size of the two samples is <= 25.
    HTH.
    --
    Bruce Weaver
    Email: [email protected]
    Version: Stata/MP 18.5 (Windows)

    Comment


    • #3
      At this thread, in #6, there is a comment on the issue, with comparisons among Stata, R and SPSS.
      Best regards,

      Marcos

      Comment


      • #4
        Hi Bruce and Macros,

        Many thanks for all your helpful responses. Have a lovely day !

        Comment

        Working...
        X