I was using the following code to create dummy variables for each year, run regression and plot the coefficients on these dummies:
Without the last option, coeflabels(dlambda* = `years'), the graph generated is

I got two issues:
First, as you can see, the names of these dummy variables make the plot look horrible. How can I change the labels for all of them in batch? For example, I want something like
and so on.
Second, I want to plot a vertical line at dlambda2004. How can I do this? Thanks!
Code:
levelsof fyear, local(years)
foreach i in `years' {
gen lambda`i' = 0
replace lambda`i' = 1 if fyear == `i'
gen dlambda`i' = d * lambda`i'
}
regress ml_w d p dlambda*
levelsof fyear, local(years)
coefplot, drop(_cons d p) vertical ciopts(recast(rcap)) yline(0) msymbol(d) coeflabels(dlambda* = `years')
I got two issues:
First, as you can see, the names of these dummy variables make the plot look horrible. How can I change the labels for all of them in batch? For example, I want something like
Code:
label dlambda2001 2001
Second, I want to plot a vertical line at dlambda2004. How can I do this? Thanks!

Comment