Announcement

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

  • Ranksum Test (Mann Whitney U /Wilcoxon Test)

    Hi all,

    I have problems conducting the Mann Whitney U test using the ranksum v, by(catvar1) exact command. In my case the two groups are already separated into two different columns "average_rating_top" and "average_rating_mid". How can I conduct the Mann Whitney U test by comparing the values in two distinct columns instead using "by"?

    Any help is very much appreciated!
    Thanks a lot!!

    Anna

  • #2
    If the alignment in observations (rows) means something then the test does not apply.

    If it means nothing, and say just arises from a dopey spreadsheet, then you can only proceed with a different data layout.


    There is no data example in #1, but this may help.


    Code:
    clear 
    input average_rating_top average_rating_mid
    1  5 
    2  6
    3  7
    4  . 
    end 
    
    stack average_rating_top average_rating_mid, into(average_rating) clear 
    
    rename _stack which 
    label def which 1 top 2 mid 
    label val which which 
    
    list 
    
    ranksum average_rating, by(which)

    Comment


    • #3
      Thanks a lot! Very helpful

      Comment


      • #4
        I use the exact option to report the p-value. There is an error saying "number of observations must be <= 1,000 for exact option". I have approx 1,300 observations in each group. How can I solve this?

        Help is very much appreciated.
        Thanks a lot.

        Comment


        • #5
          What is the reported P-value? Even a tiny difference will be highly significant with those sample sizes. In fact t tests might be defensible.

          If you have the same number of observations in each group, it sounds as if they are really paired.

          Comment


          • #6
            Thanks Nick. The p-value cannot be reported. The exact option used for calculating the p-value results in the above mentioned error message. The observations are not paired and the no of observations differs across groups.

            Comment


            • #7
              I think a comparative graph would yield more insight.

              Comment

              Working...
              X