Announcement

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

  • Stata reports decimals in IQR

    I want to report the interquartile range of charlson comorbidity index. I want do to that for a group of patients that actually died and for a group that survived. When I ask stata to report the IQR of the patients who died i get a p75 of 3,5. (so with a decimal). This value actually has no meaning(since you can't have a half comorbidity, you either have it or not). How can I prevent stata to report a decimal when there is none in the dataset when presenting the IQR?

    The code I use:
    . tabstat(charlson_comorbidity_scale_sum) if died == 1, statistics(p75)

    variable | p75
    -------------+----------
    charlson_c~m | 3.5
    ------------------------

  • #2
    That happens when your sample size is such that none of the observations can be the 75th percentile. This is easier to see with the 50th percentile. Say you have 4 observations, which one is the middle? The 2nd and the 3rd observation are both equally viable choices, so it is common to choose the middle between the second and the third observation. This is not about small sample size, it happens for the 50th percentile whenever the sample size is an even number.
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Dear Maarten,

      I see, thank you for your quick reply!

      Best regards,

      Anne

      Comment

      Working...
      X