Hi Statalist,
I am trying to produce that hazard rate at different time points. I cannot share my data due to it being sensitive data, but I can share the code I used.
I first set up my survival data
I then get the cumulative hazard with:
However, I would like to get the hazard rate not the cumulative hazard. I followed the advice here: https://www.stata.com/statalist/arch.../msg00658.html
(stkerhaz (SSC) by Enzo Coviello)
I am not sure if this is the correct way to calculate the hazard rate? I am getting confused because I’ve seen suggestions to use this:
Saving the file gives me the estimates but no 95% confidence interval.
I am trying to produce that hazard rate at different time points. I cannot share my data due to it being sensitive data, but I can share the code I used.
I first set up my survival data
Code:
stset survtime, failure(fail==1)
Code:
sts list, cumhaz risktable (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14)
Code:
ssc install stkerhaz stcoz, estimate basech(H) stkerhaz, basecha(H) bwidth(5) ci out (hazard_rate, replace) use hazard_rate, clear
I am not sure if this is the correct way to calculate the hazard rate? I am getting confused because I’ve seen suggestions to use this:
Code:
Sts graph, ci hazard Sts graph, ci hazard outfile (hazard)