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
Graph of mean/ci over time by categorical variableHi, I am relatively new to stata but have looked for help ciplot and help xtgraph plus hours online …
convert excels files to .dta filesHello, I need to convert some excel files to .dta files. I used the following command: xls2dta, sa…
Time and country random effectsHello everyone! I am working with panel data consisting of 9 countries over the period of 2000-2017…
Exporting graphs in eps formatHi, I have the following issue. I generate some graphs using marginsplot and I save them in eps fil…
How to get coefficients for other covariates in a propensity score weighting model?How to show coefficients for other covariates in a propensity score weighting model (IPW)? The PHP…
Subscribe to:
Post Comments (Atom)
0 Response to Twoway graphing: How to smooth several curves while using rarea
Post a Comment