Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 73157

Coefplot: Define range for rconnected CI plots

$
0
0
Hello,

I am trying to plot the coefficients of a regression with multiple treated groups, differentiated by intensity of treatment (I use deciles of a continuous variable). I run a diff-in-diff regression with the 10 deciles (I omit the middle decile) and then the coefplot command to plot the coefficients. I also plot the 95% confidence interval in the same graph.

I would like to include the omitted decile interaction in the coefplot. However, I don't want the confidence interval lines to connect to that point. That is, I would like the confidence interval lines (the black dashed lines in the image) to only appear between 1 and 4 and between 6 and 10, while the rconnected plot for the coefficients (the solid blue line) is defined for the entire interval. Is there a way to define the range in which the CI lines are visible? An example on what I am trying to achieve would be Figure 2 on page 167 in Deschênesand Greenstone (2011).

Please see example code and graph below. Any help would be much appreciated!

Best regards,
Simon

Code:
sysuse nlsw88, clear
* ssc install coefplot

egen dexp = xtile(ttl_exp), nq(10) // Create deciles of experience

reg wage ib5.dexp##i.collgrad

#delimit;
local lab 1/10;
coefplot, drop(_cons 0.collgrad 1.collgrad *.dexp) levels(95)
vertical yline(0) recast(connected) ciopts(recast(rconnected) lpattern(dash) color(black))
legend(order(2 "Coefficient" 1 "95% CI") row(1)) xlabel(`lab')
xtitle("Experience Decile Interacted with College Degree") title("Wage")
xsize(4.6) baselevels
;
#delimit cr
Array

Viewing all articles
Browse latest Browse all 73157

Trending Articles