Announcement

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

  • Test of difference in median

    Dear all,
    I want to test difference in median between two groups – those with eventid=1 vs. 0

    I googled and find this stata journal article, “Parameters behind "nonparametric" statistics: Kendall's tau, Somers' D and median differences”.


    pretend data :

    Code:
    clear
    input double Mdays byte eventid
    63.04238 1 
    72.77879 0 
    72.77879 0 
    72.77879 1 
    72.77879 0 
    68.61013 1 
    69.21858 1 
    end
    I tried
    cendif Mdays, by(eventid )

    but do not know if I am on the right track, and how to read the output.

    Thanks,

    Rochelle

  • #2
    You didn't say much about the variable Mdays. If it is "processed" information concerning, well, days, I gather you should think about count data analysis, Poisson-like models.

    With regards to median, you may think, theoretically speaking, about - ranksum - or - median - test.


    That said, in case we have observational data, unadjusted tests such as these ones are mainly used as an exploratory basis.


    Description

    ranksum tests the hypothesis that two independent samples (that is,
    unmatched data) are from populations with the same distribution by using
    the Wilcoxon rank-sum test, which is also known as the Mann-Whitney
    two-sample statistic (Wilcoxon 1945; Mann and Whitney 1947).

    median performs a nonparametric K-sample test on the equality of medians.
    It tests the null hypothesis that the K samples were drawn from
    populations with the same median. For two samples, the chi-squared test
    statistic is computed both with and without a continuity correction.
    Indeed, if both groups have the same pattern of variance, I believe both tests would provide similar results.

    To end, - cendif - "Robust confidence intervals for median and other percentile differences between two groups", is a user-written SJ program, as you are expected to underline. Its author is Roger Newson, an active member in this Forum.
    Last edited by Marcos Almeida; 16 Sep 2017, 15:32.
    Best regards,

    Marcos

    Comment


    • #3
      Thanks Marcos. You are quite helpful !

      Rochelle

      Comment


      • #4
        In Conroy's paper, http://www.stata-journal.com/article...article=st0253, you can run a quantile regression to test the equality of medians between two groups (page 188).
        Code:
        qreg Mdays eventid
        Ho-Chuan (River) Huang
        Stata 19.0, MP(4)

        Comment

        Working...
        X