Announcement

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

  • Using stset with exit to run Cox at different time horizons.

    Hello,

    I was wondering if it was possible to use stset with exit to run Cox models at time horizons such as 1-, 2-, and 3-years.

    The idea is that some factors may not be associated with the dependent variable at certain time horizons.

    Right now, the stset command looks like this:

    stset end_date, id(idno) failure(dep_var==1) origin(dob) enter(date_entry)

    To get stset at different time horizons, can I do something like this?

    stset end_date, id(idno) failure(dep_var==1) origin(dob) enter(date_entry) exit(date_entry + (2*365.25)) /* where 2 is for 2-years, the time-horizon of interest*/

  • #2
    I was wondering if it was possible to use stset with exit to run Cox models at time horizons such as 1-, 2-, and 3-years.
    Yes.

    The idea is that some factors may not be associated with the dependent variable at certain time horizons.
    But you cannot model this by changing the exit time.

    In a proportional hazards model, the assumption is that the strength of association of any factor remains the same at all times (this is the propotional hazards assumption). If, in reality, it is not the case, if you change the exit time, you will see different hazard ratios for such a factor. But none of those hazard ratios is then correct: all of them are mixtures of the true hazard ratios that prevail at different times.

    What you need to do in this situation is model an interaction between the factor and _t. Some simple models of this can be done using the -tvc()- and -texp()- options. Other models of time varying effects (= violation of the proportional hazards assumption) must be hand-coded.

    Comment


    • #3
      Thanks a lot, Clyde for the response! I have already checked the KM curve and it appears that the PH assumption holds. However, I will do as you suggested too!

      However, my boss would like some sensitivity analyses showing how the results vary at different time horizons. I think he is thinking in more clinical terms about predicting the dependent variable to give the level of risk an individual patient has within a time period.

      If I needed to run the Cox models at different time horizons would I do the following?:

      stset end_date, id(idno) failure(dep_var==1) origin(dob) enter(date_entry) exit(date_entry + (2*365.25)) /* where 2 is for 2-years, the time-horizon of interest*/

      Comment


      • #4
        Code:
        stset end_date, id(idno) failure(dep_var==1) origin(dob) enter(date_entry) exit(time date_entry + (2*365.25))

        Comment


        • #5
          Thank you, Clyde

          Comment

          Working...
          X