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=5
for year1
to year5
, and another horizontal line segmentx=4
for year6
to year10
.A shaded area ranging from
x=4
tox=6
for year1
to year5
, and another shaded area ranging fromx=2
to4
for year6
to year10
.
(Note that my horizontal axis is year
, and my vertical axis is coefficient for x
.)
Any help is greatly appreciated!