I plan to run the following cross-sectional regression for 10 years and plot the coefficient estimate for variable x in one graph.
Thanks to this post, I wrote the following and it works:
forvalues i=1/10 {
reg y x if year==1
estimates store year`i'
local allyears `allyears' year`i' ||
local labels `labels' `i'
}
coefplot `allyears', keep(grade) vertical bycoefs bylabels(`labels')
I want to add the following to the same graph but don't know how:
A horizontal line segment
x=5for year1to year5, and another horizontal line segmentx=4for year6to year10.A shaded area ranging from
x=4tox=6for year1to year5, and another shaded area ranging fromx=2to4for year6to year10.
(Note that my horizontal axis is year, and my vertical axis is coefficient for x.)
Any help is greatly appreciated!
