I have two 95% confidence intervals I would like to display side by side in one coeff plot in Stata.
The first is just a regression that I run, and I use coefplot to plot the coefficient & its 95% confidence interval.
The second, though, is not a regression. I just have a variable for a coefficient value and a variable for its standard error. I would like to hard code that coefficient & SE and make coefplot display that value. Or run a "dumb" regression using the coefficient & SE that displays a coefficient such that I can plot out that second 95% confidence interval.
Anyone know how to do this?
I tried looking things up a lot and trying some regressions, but haven't found a way to hardcode it yet.
You can do this with
ereturn post. Here's an example. I rename the variable "gear" to "HAND_CODED_COEF" to make clear that's the one I'm messing with. I'm able to change the coefficient and its standard error. (Note this uses the coefplot package available on SSC.)Here's what the coefplot command gets you:
And in case it better answers the question here's code for having one real regression (m1) and one nonsense regression where you edit things (m2). Edit I also explain how to edit the point estimate and confidence interval for the constant term specifically, and I add an xline to the coefplot showing that the confidence interval is as expected.