Hello. I am looking for some help with graphing a survival curve for the following stratified Weibull model:
streg i.age_q i.comorb, distribution(weibull) strata (gender)
Of course, stcurve does not work with stratified models. For my stratified cox model I used the following code:
stcox i.age_q i.comorb, basesurv(baseline) strata (gender)
gen s1=baseline if gender==1
label var s1 "female"
gen s2=baseline if gender==0
label var s2 "male"
sort _t
twoway line s1 _t, connect(stairstep) || /*
*/ line s2 _t, connect(stairstep) ||, /*
*/ legend(rows(1)) title("Stratified cox regression")/*
*/ xtitle("analysis time")
However, this does not work for the Weibull model as the basesurv option does not apply to streg. Any suggestions would be appreciated. Thank you!
streg i.age_q i.comorb, distribution(weibull) strata (gender)
Of course, stcurve does not work with stratified models. For my stratified cox model I used the following code:
stcox i.age_q i.comorb, basesurv(baseline) strata (gender)
gen s1=baseline if gender==1
label var s1 "female"
gen s2=baseline if gender==0
label var s2 "male"
sort _t
twoway line s1 _t, connect(stairstep) || /*
*/ line s2 _t, connect(stairstep) ||, /*
*/ legend(rows(1)) title("Stratified cox regression")/*
*/ xtitle("analysis time")
However, this does not work for the Weibull model as the basesurv option does not apply to streg. Any suggestions would be appreciated. Thank you!
Comment