Announcement

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

  • How to find the proportion of participants that improve by a certain amount

    I need to find the proportion of participants within a group that have improved by a certain amount. Within my dataset, I have the variables legpainwalk0 (baseline) and legpainwalk3 (52 weeks) with scores for these groups ranging from 0-10. I want to find the proportion of people that have improved by 2 points or more from baseline however, I am unsure of how to do this, any help would be greatly appreciated.

    Thanks! Erica

  • #2
    Sounds like

    Code:
    bysort group : egen wanted = mean(cond(!missing(legpainwalk0, legpainwalk3), (legpainwalk3 - legpainwalk0) >= 2, .))
    See also https://journals.sagepub.com/doi/pdf...867X1101100210 especially Section 9.

    The logic is that (legpainwalk3 - legpainwalk0) >= 2 evaluates as true (1) or false (0) and that the mean of a (0, 1) indicator is a proportion. We just need to make sure that missing values are treated separately.

    Comment


    • #3
      That's worked, thank you so much for the help!

      Comment


      • #4
        Originally posted by Nick Cox View Post
        Sounds like

        Code:
        bysort group : egen wanted = mean(cond(!missing(legpainwalk0, legpainwalk3), (legpainwalk3 - legpainwalk0) >= 2, .))
        See also https://journals.sagepub.com/doi/pdf...867X1101100210 especially Section 9.

        The logic is that (legpainwalk3 - legpainwalk0) >= 2 evaluates as true (1) or false (0) and that the mean of a (0, 1) indicator is a proportion. We just need to make sure that missing values are treated separately.
        I also have to do this for the variables maxwalkingdistancem0 and maxwalkingdistancem3 but see the proportion of people who had an improvement of 20% from baseline how would you recommend to find this?

        Comment


        • #5
          How is that measured? What happens if the baseline is zero?

          Comment


          • #6
            This was a self-report measure with participants reporting in metres how far they are able to walk. The lowest score at baseline was 2m

            Comment


            • #7

              So you want the mean of
              Code:
              cond(!missing(maxwalkingdistancem0, maxwalkingdistancem3), maxwalkingdistancem3 >= 1.2 * maxwalkingdistancem0), .)
              presuming that 20% improvement means 20% improvement or more.

              Comment

              Working...
              X