Dear Stata specialists,

I have some questions of how to draw cumulative incidence plot using Stata.

What I have is typical survival data:
  • outcome: development of CVD (0/1)
  • exposure: RA (0/1)
  • censoring: death during follow-up, emigration during follow-up or end of study (0/1)
  • follow-up time in years
I wanna draw a cumulative incidence plot and calculate the cumulative incidence at year 1, 5 and 10. I have seen people use this kind of coding to draw the plot:

stset time, f(status == 1)
stcompet ci = ci, compet1(2)
gen si_ci2 = ci if status == 2
gen aids_ci2 = ci if status == 1
gen aids_s2 = 1 - aids_ci2
label variable aids_s2 "Aids-free survival (corrected)"
label variable aids_s "Aids-free survival (naive)"
label variable si_ci2 "Cum. Inc. of SI (corrected)"
label variable si_ci "Cum. Inc. of SI (naive)"
graph tw line aids_s2 si_ci2 aids_s si_ci time if time <= 13, ///
lcolor(navy maroon ltblue erose)

What I'm confused about is that in my study death during follow-up is the only competing event, and I classified it into censor. Then what should I specify in -stcompet- ? Or this coding does not apply to my data?

Does anyone have any suggestion about this? If possible, I also would like to know how to generate life table along with cumulative incidence plot.

Thank you in advance!

Best,
Z.