Dear Stata users,
I am using -coefplot- to vizualize average marginal effects. I am looking a way how to specify -mlabel- to plot point estimates together with significance levels. Using graph editor, I added significance levels manually to the point estimates. The graph shall in the end look like this:
I managed to create a version with point estimates (see last line):

I also managed to create another version with significance levels (see the last two lines of code):

The manual also offers a solution how to display p-values as well (see last line):

Can you please help me to combine point estimates and significance levels as depicted in the first graph?
Thanks a lot!
All the best,
Pavel
I am using -coefplot- to vizualize average marginal effects. I am looking a way how to specify -mlabel- to plot point estimates together with significance levels. Using graph editor, I added significance levels manually to the point estimates. The graph shall in the end look like this:
I managed to create a version with point estimates (see last line):
Code:
coefplot bigmodel_SocAct, baselevels keep(z_v2x_civlib:0.v2x_regime_01 GDPcivlib:0.v2x_regime_01 z_v2x_clpol:0.v2x_regime_01 GDPclpol:0.v2x_regime_01 z_v2x_diagacc:0.v2x_regime_01 GDPdiag:0.v2x_regime_01 /// z_v2x_civlib:1.v2x_regime_01 GDPcivlib:1.v2x_regime_01 z_v2x_clpol:1.v2x_regime_01 GDPclpol:1.v2x_regime_01 z_v2x_diagacc:1.v2x_regime_01 GDPdiag:1.v2x_regime_01) /// order(z_v2x_civlib:0.v2x_regime_01 GDPcivlib:0.v2x_regime_01 z_v2x_clpol:0.v2x_regime_01 GDPclpol:0.v2x_regime_01 z_v2x_diagacc:0.v2x_regime_01 GDPdiag:0.v2x_regime_01 /// z_v2x_civlib:1.v2x_regime_01 GDPcivlib:1.v2x_regime_01 z_v2x_clpol:1.v2x_regime_01 GDPclpol:1.v2x_regime_01 z_v2x_diagacc:1.v2x_regime_01 GDPdiag:1.v2x_regime_01) /// xtitle("Average marginal effects (AME)") xline(0) /// format(%9.2f) mlabposition(12) mlabgap(*2) mlabel
I also managed to create another version with significance levels (see the last two lines of code):
Code:
coefplot bigmodel_SocAct, baselevels keep(z_v2x_civlib:0.v2x_regime_01 GDPcivlib:0.v2x_regime_01 z_v2x_clpol:0.v2x_regime_01 GDPclpol:0.v2x_regime_01 z_v2x_diagacc:0.v2x_regime_01 GDPdiag:0.v2x_regime_01 /// z_v2x_civlib:1.v2x_regime_01 GDPcivlib:1.v2x_regime_01 z_v2x_clpol:1.v2x_regime_01 GDPclpol:1.v2x_regime_01 z_v2x_diagacc:1.v2x_regime_01 GDPdiag:1.v2x_regime_01) /// order(z_v2x_civlib:0.v2x_regime_01 GDPcivlib:0.v2x_regime_01 z_v2x_clpol:0.v2x_regime_01 GDPclpol:0.v2x_regime_01 z_v2x_diagacc:0.v2x_regime_01 GDPdiag:0.v2x_regime_01 /// z_v2x_civlib:1.v2x_regime_01 GDPcivlib:1.v2x_regime_01 z_v2x_clpol:1.v2x_regime_01 GDPclpol:1.v2x_regime_01 z_v2x_diagacc:1.v2x_regime_01 GDPdiag:1.v2x_regime_01) /// xline(0) xtitle("Average marginal effects (AME)") /// format(%9.2f) mlabposition(12) mlabgap(*2) mlabel("p = " + string(@pval,"%9.3f")) cond(@pval<.001, "***", cond(@pval<.01, "**", cond(@pval<.05, "*",""))))
The manual also offers a solution how to display p-values as well (see last line):
Code:
coefplot bigmodel_SocAct, baselevels keep(z_v2x_civlib:0.v2x_regime_01 GDPcivlib:0.v2x_regime_01 z_v2x_clpol:0.v2x_regime_01 GDPclpol:0.v2x_regime_01 z_v2x_diagacc:0.v2x_regime_01 GDPdiag:0.v2x_regime_01 /// z_v2x_civlib:1.v2x_regime_01 GDPcivlib:1.v2x_regime_01 z_v2x_clpol:1.v2x_regime_01 GDPclpol:1.v2x_regime_01 z_v2x_diagacc:1.v2x_regime_01 GDPdiag:1.v2x_regime_01) /// order(z_v2x_civlib:0.v2x_regime_01 GDPcivlib:0.v2x_regime_01 z_v2x_clpol:0.v2x_regime_01 GDPclpol:0.v2x_regime_01 z_v2x_diagacc:0.v2x_regime_01 GDPdiag:0.v2x_regime_01 /// z_v2x_civlib:1.v2x_regime_01 GDPcivlib:1.v2x_regime_01 z_v2x_clpol:1.v2x_regime_01 GDPclpol:1.v2x_regime_01 z_v2x_diagacc:1.v2x_regime_01 GDPdiag:1.v2x_regime_01) /// xline(0) xtitle("Average marginal effects (AME)") /// format(%9.2f) mlabposition(12) mlabgap(*2) mlabel("p = " + string(@pval,"%9.3f"))
Can you please help me to combine point estimates and significance levels as depicted in the first graph?
Thanks a lot!
All the best,
Pavel
Comment