Announcement

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

  • Confidence Intervals and Wilcox Signed Rank Test

    Hello - could you assist me with the Stata command/process of commands for producing confidence intervals with a Wilcox Signed Rank Test? I'm using the commands:
    mean variable1
    mean variable2

    signrank variable1=variable2

    I get a test statistic and p value, but no confidence intervals. I looked up signrank in Stata help and do not see any options for producing confidence intervals either.

    Any suggestions would be greatly appreciated. Thank you.

    Leslie Muller




  • #2
    Leslie:
    welcome to the list.
    The following link may be useful: http://www.stata-journal.com/sjpdf.h...clenum=snp15_6
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      The name Wilcox here is likely to be a typo for Wilcoxon arising from R's bizarre choice of function name. Oddly, however, at least two people called Wilcox have also worked in nonparametric or robust statistics.

      Comment


      • #4
        That's very helpful! Thank you!
        Leslie

        Comment


        • #5
          Carlo,
          I have one more question for you. I did the SomersD test, but am not getting a confidence interval that makes sense in the context of my difference in means. The estimate for absdiff here is not anywhere near equal to the difference in the means of the two variables that I'm comparing (difference is 5.581, not found in my output below; SomersD absdiff is 0.212). Hence, reporting the confidence interval doesn't make any sense next to the actual difference. In my code/output below I first show the means of my two variables of interest, then execute the SomersD code:

          .mean totalvisits_ed_pre

          Mean estimation Number of obs = 339
          --------------------------------------------------------------------
          | Mean Std. Err. [95% Conf. Interval]
          -------------------+------------------------------------------------
          totalvisits_ed_pre | 14.90265 .5064196 13.90652 15.89879
          --------------------------------------------------------------------

          . mean totalvisits_ed_post
          Mean estimation Number of obs = 339

          ---------------------------------------------------------------------
          | Mean Std. Err. [95% Conf. Interval]
          --------------------+------------------------------------------------
          totalvisits_ed_post | 9.321534 .4895261 8.358632 10.28444
          ---------------------------------------------------------------------

          .gen signdiff=sign(totalvisits_ed_pre-totalvisits_ed_post)
          . gen absdiff=abs(totalvisits_ed_pre-totalvisits_ed_post)
          . somersd signdiff absdiff if absdiff!=0,transf(z)
          Somers' D with variable: signdiff
          Transformation: Fisher's z
          Valid observations: 327

          Symmetric 95% CI for transformed Somers' D
          ------------------------------------------------------------------------------
          | Jackknife
          signdiff | Coef. Std. Err. z P>|z| [95% Conf. Interval]
          -------------+----------------------------------------------------------------
          absdiff | .2121719 .0814114 2.61 0.009 .0526085 .3717354
          ------------------------------------------------------------------------------

          Asymmetric 95% CI for untransformed Somers' D
          Somers_D Minimum Maximum
          absdiff .20904447 .05255998 .35550873

          ************************************************** ***

          Thank you again!
          Leslie

          Comment


          • #6
            Leslie:
            I would say that you're expecting the wrong answer from Somers'D statistics.
            See, for instance, pages 323-324 of the reference quoted in my previous reply.
            However, another approach that may be useful when the requirements of the -ttest- are violated, is a bootstrap (or bootstrapped) -ttest-; see, if interested, -bootstrap- entry in Stata .pdf manual.
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment

            Working...
            X