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
Related Posts with Twoway graphing: How to smooth several curves while using rarea
Count unique appearance of values across multiple variables in wide formatHello! It has been a while since I have used Stata and I need a bit of help. I have a wide dataset…
Panel Var and Fan ChartsHi all, Its bit urgent please I'm using panel var in my project, i need little help could anyone …
Adjacency matrix大家好: 如何使用统计码构建中国各省的(0,1 )空间邻接矩阵 …
Generating IDsDear all, Suppose I have the following dataset Code: clear input var1 var2 1 1 1 2 1 3 1 4 2 1 2 …
Bysort and egen code not carrying over correct dataHello, I have a long data set containing college enrollment data by term, multiple instances per st…
Subscribe to:
Post Comments (Atom)
0 Response to Twoway graphing: How to smooth several curves while using rarea
Post a Comment