Announcement

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

  • survival analysis up to specific timepoint

    Dear all,

    I have survival data with a follow-up of 30 months, however I would like to compare survival until 24 months. I would like to do so using Kaplan-Meier curves and log-rank testing.

    I was trying around already with the stsplit command, but so far did not get the hang of it, does anyone have suggestions for me?

    Best

  • #2
    The way to do this is to censor at 24 months any observation that has not failed up to that point. So if your original survival time variable is called time and your original failure variable (0 = censored, 1 = failed) is called fail, you can do something like this:
    Code:
    gen time2 = min(time, 24)
    gen fail2 = fail
    replace fail2 = 0 if time > 24 & !missing(time)
    stset time2, failure(fail2) // PERHAPS OTHER OPTIONS
    and then run your survival analysis command (-stcox-, -stcrreg-, -sts test-, whatever).

    Comment


    • #3
      Clyde's solution should work well, but perhaps an easier option is to use the -exit()- option of -stset-

      Code:
      stset time, failure(fail=1) exit(time 24)

      Comment

      Working...
      X