I am using Cox proportional hazar model with time dependent variables, I want to graph how hazard ratio changes over time for each variable. This is the code I use,
Code:
xi:stcox i.migstatus i.sex_gen i.cohort i.eductv i.preg i.numkid, tvc(i.migstatus i.sex_gen i.eductv i.preg i.numkid ) texp(_t)
Code:
stset beg, failure(typeb=2) origin(origin16) id(id) stsplit, at(failures) xi:stcox i.migstatus i.sex_gen i.cohort i.eductv i.preg i.numkid c._t#i.migstatus c._t#i.sex_gen c._t#i.eductv c._t#i.preg c._t#i.numkid
Thus if you have any suggestions to represent a graph of coefficients changing over time ( it doesn't have to be all time points), I appreciate a lot.
0 Response to Graphing change in the hazard ratios after stcox tvc() option
Post a Comment