Announcement

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

  • Estimating Cox proportional hazard ratios at specific time points

    Dear Stata team,

    I am working on a survival analysis and I have used the --stptime, by(Var) at (30(30)360)-- command to generate the incidence rate at various time points. I wanted to do something similar with the model to calculate the hazard ratios at different time points but can't figure out how to do it.

    Could someone help please?

  • #2
    Bode, a temptative reply:
    Code:
    use http://www.stata-press.com/data/r13/kva.dta
    by failtime , sort: stcox load bearings
    A possible drawback with this approach (in the above example, at least) is that you might not have sufficient observations to calculate the HR for each specific time point.

    Kind regards,
    Carlo
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      I don't think that the hazard ratio at a single point in time is meaningful, but you can estimate it for selected time intervals:
      Code:
      webuse diet.dta , clear
      stset dox , failure(fail=1 3 13) enter(doe) origin(doe) scale(365.25) id(id)
      stsplit time, at(0 5 10 15 25)
      recode job (1 2 = 1)
      bysort time: stcox job , nolog

      Comment


      • #4
        Your question is confusing, in part because you misunderstand stptime. (You have not helped by your failure to show, as requested in the FAQ, the exact stptime statement you used and the output from that statement; surely "Var" is not the name of your time variable.) stptime does not compute incidence (hazard) rates the specific times given in the at(); rather it uses those times to define endpoints of intervals, and it estimates the incidence rate for the entire interval. If you imagine that each time point has a different incidence (hazard) rate, the the estimate (events/person-time) is roughly the average of those rates. It will be the rate at each time point in the interval only if the rate is the same at every point. This true of the survival model called the exponential; and the collection is called a "piece-wise exponential" distribution.

        Hence, Svend gives you a different hazard model for each interval. (Again, you don't show the stcox statements you tried, so we can't tell exactly what model you hope to run.) it turns out that if the covariate ("job" in Svend's example) does not interact with time than the hazard ratiofor that covariate is the same for all observations in the interval even though the hazard ratesthemselves need not be.
        Steve Samuels
        Statistical Consulting
        [email protected]

        Stata 14.2

        Comment


        • #5
          Thank you all for shedding some light on this. I guess missed the fact the rates or ratios are for time intervals and not time points.

          I used the following command to get the hazard rates: stptime, by(state) at (30(30)360)

          To run the hazard ratios, I just used the simple command: xi: stcox i.state age female but wasn't sure how to split it to different time points.

          I understand better now. Thank you.

          Comment

          Working...
          X