Announcement

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

  • One-tailed Mann-Whitney U test

    Dear Stata users,

    I need to compare the mean of two variables using a Mann-Whitney U tests. I usually use this test as : |ranksum [depvar], by ([grouping var])|. But the result I found gives me the p-value for a two-sided tests. In the present case, I need to get the p-value for a one-sided test. I do not find any option that can provide me the p-value for a one-sided test. I know that the ttest can give me the p-value for a one-sided test but assumptions for this test are not respected in my case so I need to use a Mann Whitney U test. Do you have any idea, option of the rank-sum test that can provide me the p-value for the one-sided test?

    Many thanks

  • #2
    Welcome to Statalist!

    My understanding of the Mann-Whitney U is that it tests the hypothesis that the two distributions are the same, not whether the measure of central location is the same. See the example in the section on the object of the test in the Wikipedia article on the test. So with that understanding, 1- versus 2-sided does not pertain.

    Perhaps another reader will be able to find a way to interpret the test as you need, or suggest an alternative test.

    Comment


    • #3
      Hi:

      Provided you are willing to assume that both distributions have the same shape&spread, then the Mann-Whitney's U test becomes a test for the difference in location (difference in medians), and it might make sense to ask for a one-tailed p-value.

      Since the distribution of U statistics is symmetric, you can compute a one-tailed p-value by dividing the two-tailed one by 2. As a matter of fact, the exact p-value (not calculated by ranksum) is computed by multiplying by 2 the one-tailed p-value.

      HTH
      Last edited by Marta Garcia-Granero; 31 May 2016, 09:10.

      Comment


      • #4
        What's the reason for using the Mann-Whitney here, as opposed to a conventional t-test? There are various different reasons for this choice, and a recommendation of a different test would depend on which reason you cite. Also, William is right that the M-W is sensitive to things other than a difference in location.

        Comment


        • #5
          You are receiving very good advice on the topic. Anyway, if you still want to get the one-tailed p-value:

          Code:
          sysuse auto.dta
          ranksum price, by(foreign)
          display normal(`r(z)')

          Comment


          • #6
            Stephanie:
            Welcome to the list.
            As an aside to previous helpful advice, I would also consider a -bootstrap- ttest (please see -bootstrap- entry in Stata .pdf manual.
            Kind regards,
            Carlo
            (StataNow 18.5)

            Comment


            • #7
              Thank you all for your replies.
              In my case, I compare two samples of a discrete variable and I cannot assume the hypothesis of a normal distribution (and so use a t-test).
              I will thus divide by 2 the two-tailed p-value.
              Regards,
              Stéphane

              Comment


              • #8
                Dear Stata Users,

                As for me, I would like to test for the assumption of randomness and independent observations for the Mann Whity U test. How do I go about it?

                Comment


                • #9
                  Vincent:
                  see -help ranksum-.
                  Kind regards,
                  Carlo
                  (StataNow 18.5)

                  Comment

                  Working...
                  X