Hello,
I am implementing a proportional cox model to investigate the hazard ratio of a second birth, but I am encountering some issues with the plots after using stset and stcox.
I have first created a Person-period file and estimated h(t) as observed value of Pr(T=t|T>=t) at each time T
bysort t: egen ht_obs = mean(secondbirth)
and plotting it against time I obtained a reliable estimate.

However, when I use:
stset _period, id(id2) failure(birthtest)
sts graph, hazard
I obtain a complete different picture, and the same happens when I estimate a cox model with -stcox- and then plot the outcome with -stcurve-.


I am not sure how to interpret these results but most importantly I cannot understand where I got wrong as the -stdes- gives a reliable outcome and the structure of the data does not seem to be an issue per se.
Thank you very much
Elena
I am implementing a proportional cox model to investigate the hazard ratio of a second birth, but I am encountering some issues with the plots after using stset and stcox.
I have first created a Person-period file and estimated h(t) as observed value of Pr(T=t|T>=t) at each time T
bysort t: egen ht_obs = mean(secondbirth)
and plotting it against time I obtained a reliable estimate.
However, when I use:
stset _period, id(id2) failure(birthtest)
sts graph, hazard
I obtain a complete different picture, and the same happens when I estimate a cox model with -stcox- and then plot the outcome with -stcurve-.
I am not sure how to interpret these results but most importantly I cannot understand where I got wrong as the -stdes- gives a reliable outcome and the structure of the data does not seem to be an issue per se.
Thank you very much
Elena
Comment