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
calculating the growth rate of a phenomenon from its columnsI'm trying to calculate the transmission rate of the virus by country as new column variables. I wan…
Store Coefficient after loop regressionsDear all, For our master paper, we need to replicate the Fama and French three factor model. We sta…
IRA syntaxhalo everyone, if I want to adjust the null distribution to perform rWG (interrater agreement). I ha…
problem with reshape, always show that "variable demacity-2001 implied name too long"I have tried many times without success with "reshape long demacity- demanation, i(citycode_s ) j(ye…
Simulteneously executing multiple do filesSuppose I have three do files with following commands in them File diX.do : di "X" File diY.do : di …
Subscribe to:
Post Comments (Atom)
0 Response to Twoway graphing: How to smooth several curves while using rarea
Post a Comment