Hi,
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)
I know tvc option limits a lot of post estimation, so below gives same result;
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
I see somewhere they recommend using "coefplot" package (https://stackoverflow.com/questions/...ient-over-time). I first tab _t, and try to get hazard ratios at specific time with "if"option, but it doesn't work at all output doesn't give anything.

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.