I need to extract the baseline hazards from a general survival model (GSM) that I've constructed using the rstpm2-package (a conversion of the stpm2 module in stata).
using the data in the rstpm2-package let's use this as an example:
library(rstpm2)
gsm <- stpm2(Surv(rectime,censrec==1)~hormon, data=brcancer, df=3)
sum.gsm <- summary(gsm)
So I've noticed that the summary has an element named bhazard:
sum.gsm@args$bhazard
However it seems to be filled with zeroes and holds one value per patient. As far as I understand the baseline hazard should consist of one hazard for every time-point in the data.
Does anyone have any experience that could be of assistance