Dear community,
I am running a survival analysis and for now, I was plotting the p-value of log-rank test into my graph:
However, I would now like to plot the Hazard Ratio as per Cox regression into my graph:
If I understand the -stcox- helpfile correctly, the Hazard Ratio is not automatically stored in e(), but should be in r(table). By the looks of it, the Hazard ratio is 'b' in r(table). I tried to code this, but cannot figure out the syntax to specify 'b' (if this is really the HR).
My try:
How do I get the Hazard Ratio to appear in my graph?
Thank You!
I am running a survival analysis and for now, I was plotting the p-value of log-rank test into my graph:
Code:
sts test rand di chi2tail(`r(df)',`r(chi2)') local a=round(chi2tail(`r(df)',`r(chi2)'), 0.001) sts graph, by(rand) ci ciopts(fcolor(%10)) text(.95 518400000 "Log-rank p=`a'") title("") subtitle("") ytitle("") xtitle("") ylabel(0(0.1)1, angle(horizontal))
Code:
stcox i.rand
My try:
Code:
stcox i.rand local b=round(stcox(`r(table)'), 0.001) sts graph, by(rand) ci ciopts(fcolor(%10)) text(.95 518400000 "Cox HR=`b'") title("") subtitle("") ytitle("") xtitle("") ylabel(0(0.1)1, angle(horizontal))
Thank You!
Comment