Dear Statalisters,

I am currently working on a twoway graph using point estimates created by using a stcompet command, producing the estimates for plotting the cumulative incidence and upper and lower confidence interval bounds. To shade the area between the confidence intervals, I'm using twoway area and for the incidence curve I am using a simple line option to make the confidence interval lines to correspond to the cumulative incidence curve.

The problem I face is that I have to smooth these lines due to institute policies, and to my understanding - I can't add the lowess option while simultaneously using rarea and line commands.

Is there a way to smooth the curves used by rarea and line? I've tried to search through this forum and different books without finding a good solution for this.

My syntax looks somewhat like this:

twoway (rarea CI_low CI_upper year, fcolor("75 45 122") fintensity(20) lcolor(white)) ///
(line CI_est year, lcolor("72 44 122") lpattern(solid) lwidth(thick)), ///
ytitle("{bf: Cumulative incidene of"} "{"bf: disease (%)}", margin(medium))
yscale(range (0 20)) ///
ylabel(0 "0" 5 "5" 10 "10" 15 "15" 20 "20", angle(horizontal)) ///
xtitle("{bf: Years of age}", margin(medium)) ////
xscale(range(0 40)) ///
xlabel(0 (10) 40) ///
graphregion(color(white)) ///
xsize(8) ysize(4)

Any help would be highly appreciated since I know about other colleagues that are having similar issues.

Kind regards,
Håkon