Hi I've been using -stpm2- from: https://pclambert.net/software/stpm2/stpm2_timevar/
Is it possible to have prediction curves for hormon 0 and hormon 1 as a function of age on the same graph **WITH CONFIDENCE INTERVALS <<--- this is my problem ?
P Lambert's original code
I've tried the below
Stata error:
twoway is not a twoway plot type
Is there anyone who knows if this possible?
I know that this works - but it does not plot the confidence intervals for the hormon 1
Is it possible to have prediction curves for hormon 0 and hormon 1 as a function of age on the same graph **WITH CONFIDENCE INTERVALS <<--- this is my problem ?
P Lambert's original code
Code:
predict t1_age, surv at(hormon 0 pr_1 3.43) ci timevar(t1) twoway (rarea t1_age_lci t1_age_uci age, sort color(blue%25)) /// (line t1_age age, sort lcolor(red)) /// ,ytitle("1 year survival") legend(off) /// ylabel(,angle(h) format(%3.1f)) name(age_t1, replace)
Code:
predict t5_age, surv at(hormon 0 pr_1 3.43) ci timevar(t5) predict t5_age2, surv at(hormon 1 pr_1 3.43) ci timevar(t5) twoway (rarea t5_age_lci t5_age_uci age, sort color(blue%25)) /// (line t5_age age, sort lcolor(red)) || twoway (rarea t5_age2_lci t5_age2_uci age, sort color(blue%25)) (line t5_age2 age, sort lcolor(red)) ,ytitle("5 year survival") legend(off) ylabel(,angle(h) format(%3.1f)) name(age_t5, replace)
twoway is not a twoway plot type
Is there anyone who knows if this possible?
I know that this works - but it does not plot the confidence intervals for the hormon 1
Code:
//No confidence intervals for t5_age2 twoway (rarea t5_age_lci t5_age_uci age, sort color(blue%25)) /// (line t5_age age, sort lcolor(red)) || (line t5_age2 age, sort lcolor(red)) ,ytitle("5 year survival") legend(off) ylabel(, angle(h) format(%3.1f)) name(age_t5, replace) //Attempt with confidence intervals for t5_age2 twoway (rarea t5_age_lci t5_age_uci age, sort color(blue%25)) /// (line t5_age age, sort lcolor(red)) || (line t5_age2 age, sort lcolor(red)) twoway (rarea t5_age2_lci t5_age2_uci age, sort color(blue%25)) ,ytitle("5 year survival") legend(off) ylabel(,angle(h) format(%3.1f)) name(age_t5, replace) //error: twoway is not a twoway plot type
Comment