I'm having trouble creating a legend symbol that combines both a coefficient marker and its confidence interval in a graph using the coefplot command in Stata, similar to what is shown in Image 1.


Despite my attempts, I haven't been able to achieve this effect, and my current output looks like what's shown in Image 2.

Here's the code I've been using:
Could anyone offer some guidance on how to generate a legend symbol that visually represents both the coefficient and its confidence interval, as intended? Any help would be greatly appreciated.

Despite my attempts, I haven't been able to achieve this effect, and my current output looks like what's shown in Image 2.

Here's the code I've been using:
Code:
sysuse auto, clear logit foreign mpg margins, at(mpg=(10(2)40)) post estimates store bivariate logit foreign mpg turn price margins, at(mpg=(10(2)40)) post estimates store multivariate coefplot /// (bivariate, recast(line) lcolor("0 170 250") lwidth(2.5pt) ciopts(recast(rarea) fcolor("0 170 250%40") lcolor(%0))) /// (multivariate, recast(line) lcolor("200 100 0") lwidth(2.5pt) ciopts(recast(rarea) fcolor("200 100 0%40") lcolor(%0))), /// graphr(c(white)) /// xtitle(Mod) xscale(off) /// at lwidth(*2) /// legend(ring(0) pos(11) si(12pt) cols(1) rowgap(1pt) colgap(0pt) region(ls(none)) symy(4pt) symx(6pt))
Comment