When trying to depict two coefficients from one regression on separate axes with Ben Jann's superb coefplot
(ssc install coefplot
) command, the coefficient to be shown on the 2nd axis is correctly displayed, but its confidence interval is depicted on the 1st scale.
Can anyone explain how I get the CI displayed on the same (2nd) axis as the coefficient it belongs to? I couldn't find any option to change this - and imagine it should be the default, if not the only, option to plot the CI around the point estimate it belongs to.
I use the latest coefplot version with Stata 16.
Here is a minimum example to illustrate the problem:
webuse union, clear
eststo results: reg idcode i.union grade
coefplot (results, keep(1.union)) (results, keep(grade) xaxis(2))
In the line
coefplot (results, keep(1.union)) (results, keep(grade) xaxis(2))
you specify the option xaxis(2)
, but this is not a documented option of coefplot
, although it is a valid option of twoway rspike
which is called by coefplot
. Apparently, if you use xaxis(2)
something goes wrong with the communication between coefplot
and rspike
.
This works for me:
coefplot (results, keep(1.union)) (results, keep(grade) axis(2))