Announcement

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

  • Wilcoxon ranksum on left and right data

    Hi all,

    To begin, I am completely new to using Stata - this is my first use of a statistical program ever, and I did not get good instruction. So I know I am just using the program incorrectly, and need help.

    I am trying to run a Wilcoxon rank sum test on nonparametric data. I have assessed my values - measurements of pressure - in left and right fingers. I am attempting to see if there is a significant difference.

    Here is an example of the data:
    ID Left Right
    1 24 22
    2 16 19
    3 27 21
    4 13 15
    5 19 23
    6 21 21
    7 22 17
    8 25 23
    9 25 18
    My questions are these:
    How exactly do I enter this data into the data editor so that I can run a Wilcoxon ranksum? Right now it tells me I have more than 2 groups, and I can only pick left or right, or it makes me pick the person ID.
    And then - what do I use for the main and by/if/in tabs?

    I am horribly confused and at my wit's end - any help is greatly appreciated.

    Thanks,

    Becky



  • #2
    You should not do a Wilcoxon rank-sum test on this data because it consists of matched pairs. The Wilcoxon rank-sum test is for independent samples. You should do the -signrank- test instead.

    Code:
    signrank left = right

    Comment


    • #3
      Hello Becky,

      Welcome to the Stata Forum / Statalist.

      Please read the FAQ. There, you will find great information on how to post data and start a query. Thanks.

      That said, you seem to need the Wilcoxon signed-rank test, instead of the ranksum.

      For this, you shall type:

      Code:
      . signrank Left = Right
      Edited: crossed with Clyde's reply, on the same verge.
      Best regards,

      Marcos

      Comment


      • #4
        I agree with Clyde (in #2): It looks like paired data, so you want Wilcoxon's signed ranks test. As far as I can tell, signrank gives only the large-sample (asymptotic) z-test. With your small sample size, you ought to use the exact test, which can be obtained via signrankex. Here is the command to install it:

        Code:
        net install st0297.pkg
        HTH.
        --
        Bruce Weaver
        Email: [email protected]
        Version: Stata/MP 19.5 (Windows)

        Comment


        • #5
          That helps significantly, thank you. It is much easier when I am running the correct test. Thank you for your help today.

          Comment


          • #6
            Not disagreeing with any advice so far, but why assume that you have "nonparametric data" (procedures may be nonparametric, but not data)?. I'd expect pressures to be fairly well-behaved with at most some benefit from transformation. So, I would look at the distribution of the differences and an appropriate t test too.

            Comment

            Working...
            X