Dear statalister,
I am doing an analysis from time from HIV seroconversion until ART (HIV medication) start among treatment-naive with all-cause mortality as a competing risk (so event=1 is ART start and event=2 death).
I used the following code (by age group)
stcompet CIF = ci, by(agecat2) compet(2)
twoway (line CIF fu if agecat2== 1 & event==1 & hivsc==1 & year==1, sort connect(stairstep)) ///
(line CIF fu if agecat2== 2 & event==1 & hivsc==1 & year==1, sort connect(stairstep)) ///
(line CIF fu if agecat2== 3 & event==1 & hivsc==1 & year==1, sort connect(stairstep)) ///
, legend(order(1 "<=25" 2 "26-34" 3 ">=35") ///
ring(0) pos(5) cols(1)) ///
xtitle("Time from HIV seroconversion(years)") ///
ytitle("CIF")
fu is my follow-up time and i'm selecting HIV seroconverters only and that is why hivsc==1 in the selection criteria after the statement " if".
So I do obtain results which i might expect, but all lines do not start at zero.
Does anyone have an idea how I can get all lines to start at zero instead of the lowest CIF?
Thank you in advance for your help!
P.S: i posted this already in "using the forum"..as I am new to this forum Im hope this is the right place to ask my questions.
I am doing an analysis from time from HIV seroconversion until ART (HIV medication) start among treatment-naive with all-cause mortality as a competing risk (so event=1 is ART start and event=2 death).
I used the following code (by age group)
stcompet CIF = ci, by(agecat2) compet(2)
twoway (line CIF fu if agecat2== 1 & event==1 & hivsc==1 & year==1, sort connect(stairstep)) ///
(line CIF fu if agecat2== 2 & event==1 & hivsc==1 & year==1, sort connect(stairstep)) ///
(line CIF fu if agecat2== 3 & event==1 & hivsc==1 & year==1, sort connect(stairstep)) ///
, legend(order(1 "<=25" 2 "26-34" 3 ">=35") ///
ring(0) pos(5) cols(1)) ///
xtitle("Time from HIV seroconversion(years)") ///
ytitle("CIF")
fu is my follow-up time and i'm selecting HIV seroconverters only and that is why hivsc==1 in the selection criteria after the statement " if".
So I do obtain results which i might expect, but all lines do not start at zero.
Does anyone have an idea how I can get all lines to start at zero instead of the lowest CIF?
Thank you in advance for your help!
P.S: i posted this already in "using the forum"..as I am new to this forum Im hope this is the right place to ask my questions.
Comment