I would like to plot a decision analysis curve for the 5 year survival, BUT I Can't plot the upper bounds and lower bounds following a cox regression (see red, can anyone tell me what I'm doing wrong?)
I think it's something mathematical....
Appreciate if anyone can help....
Not sure If I'm asking questions in the right way, posted something else for the first time and no answer.. Was told this was a good platform...
Here's a sample of the data
I think it's something mathematical....
Appreciate if anyone can help....
Not sure If I'm asking questions in the right way, posted something else for the first time and no answer.. Was told this was a good platform...
Code:
stset ttlastfollowbcr, f(bcr) stcox modelsurgyear modelpsa modelece modelsvi modellni modelpgrade6 modelpgrade7 modelpgrade8 modelpgrade9 /// modelexperience, basesurv(surv_function) ///saving out baseline survival *get linear predictor for calculation of risk predict xb, xb sum xb, detail. predict se, stdp *baseline survival at time 5 years = 60 months sum surv_funct if _t <=60 **We want survival closest to 5 years = 60 months , this is lowest survival rate for all survival times < 5 years local base =r(min) **Generate 5 year risk using baseline survival converts into a probability gen risk5y= 1-`base'^exp(xbeta) // converts to a probability g slb= 1-`base'^exp(xbeta)+ invnorm(0.975*se) // unknown function **problem here g sub= 1-`base'^exp(xbeta)- invnorm(0.975*se) //unknwon function **problem here label var risk5y "pROBABILITY OF FAILURE AT 5 YEARS" *Plot 5 year predicted probability twoway (line risk5y slb sub experience, sort clpat(solid solid solid) clwidth(medthick thin thin) clcolor(gs0 gs0 gs0)), // ytitle(5 year probability of freedrom from recurrence (%), margin(medium)) ylabel(75(5)100, angle(horizontal) nogrid) xtitle(experience (number of cases), margin(medium)) xlabel(0(250)1750) ///legend(off) scheme(s2mono) graphregion(fcolor(white))
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte bcr float(dod ttlastfollowbcr) byte(_st _d) double _t byte _t0 float(modelsurgyear modelpsa modelece modelsvi modellni modelpgrade5 modelpgrade6 modelpgrade7 modelpgrade8 modelpgrade9 modelexperience) 0 0 11.728952 1 0 11.728952407836914 0 2003 7 0 0 0 0 1 0 0 0 1875 0 0 52.92813 1 0 52.928131103515625 0 2000 6.5 0 0 0 0 1 0 0 0 8 0 0 37.585217 1 0 37.5852165222168 0 2002 1.8 0 0 0 0 0 1 0 0 257 1 0 2.2340863 1 1 2.234086275100708 0 1991 25.3 1 1 1 0 1 0 0 0 93 0 0 4.796715 1 0 4.796714782714844 0 1997 4.96 0 0 0 0 0 1 0 0 586 0 0 80.4271 1 0 80.4271011352539 0 1997 6.7 1 0 0 0 0 1 0 0 1101 0 0 86.53799 1 0 86.5379867553711 0 1996 6.1 1 0 0 0 0 1 0 0 181 0 0 64.03285 1 0 64.03285217285156 0 1999 14 0 0 0 0 1 0 0 0 340 0 0 1.379877 1 0 1.3798768520355225 0 2001 6.8 0 0 0 0 1 0 0 0 82 0 0 54.76797 1 0 54.767967224121094 0 1993 10.62 0 1 0 0 0 1 0 0 44 0 0 19.61396 1 0 19.613962173461914 0 2003 4.24 0 0 0 0 1 0 0 0 1917 0 0 114.85831 1 0 114.85831451416016 0 1993 7.3 0 0 0 1 0 0 0 0 237 0 0 1.379877 1 0 1.3798768520355225 0 1998 5 0 0 0 0 1 0 0 0 65 0 0 1.379877 1 0 1.3798768520355225 0 2000 6.8 0 0 0 0 1 0 0 0 55 0 0 90.18481 1 0 90.18480682373047 0 1995 5 0 0 0 0 1 0 0 0 825 0 0 14.29158 1 0 14.291581153869629 0 2002 5.2 0 0 0 0 0 1 0 0 667 0 0 68.336754 1 0 68.33675384521484 0 1992 6.5 1 0 0 1 0 0 0 0 142 0 0 91.20329 1 0 91.20328521728516 0 1995 26.6 1 0 0 0 0 1 0 0 36 0 0 38.93224 1 0 38.9322395324707 0 2002 6.17 0 0 0 0 1 0 0 0 262 0 0 35.97536 1 0 35.97536087036133 0 1998 4 0 0 0 0 1 0 0 0 694 end
Comment