Is there a way to color the confidence intervals in a coefplot so that it reflects the level of significance of each coefficient? I know it is doable by manually changing the color but is there a way to do it on a systematic basis (i.e. when a coefficient statistically different from 0 with 99 percent certainty the confidence interval in the coefplot is green, when a coefficient is different from 0 at 95 percent then it is orange, 90 percent red, and below 90 percent navy?
Below is an example of how to change the color manually. In the specification only mpg is significant at the 95% level (p-value .038), the other variables are not statistically different from 0. While it is easy to do it manually it takes a lot of time when one has to change manually the color for each confidence interval over multiple graphs. So I am looking for a more systematic way to do it.
HTML Code:
sysuse auto, clear regress price mpg trunk length turn estimates store reg1 coefplot /* */ (reg1, keep(mpg) mcolor(orange) ciopts(color(orange))) /* */ (reg1, keep(trunk) mcolor(navy) ciopts(color(navy))) /* */ (reg1, keep(length) mcolor(navy) ciopts(color(navy))) /* */ (reg1, keep(turn) mcolor(navy) ciopts(color(navy))) /* */ , drop(_cons) xline(0) msymbol(s) mfcolor(white)
0 Response to Coefplot - color by level of significance
Post a Comment