Coefplot overlaps coefficient estimations

78 views Asked by At

I am trying to fix this plot made with coefplot in Stata.

enter image description here

I tried to estimate foreign trade elasticities using different proxies for relative price. I used conventional REER based on CPIs, a second one using the Internacional price/CPI, and the last one using Internacional price/ULC. These measures are competitors proxies in my model and I would like to show the different estimatiors with different specifications of the model (different group of control variables).

So, in the plot the lines with the same color include the same control variables in the model but different proxy for relative prices (triangule marker -REER_CPI-, square marker -REER_XPI - and circle marker - REER_XPI_ULC).

The problem is that in the plot the estimates are mostly overlap and non-centered. How can I fix this? I have already tried with offset(), but it didn't work.

This is my code:

     coefplot (model2, label( TCRM_IPC ) msymbol(T) mlabcolor("`r(p1)'") mcolor("`r(p1)'") mlabposition(2) ciopts(recast(rcap) lcolor("`r(p1)'")) ) ///
            (model3, label( TCRM_IPC Estabilidad) msymbol(T) mlabcolor("`r(p2)'") mcolor("`r(p2)'") mlabposition(2) ciopts(recast(rcap)  lcolor("`r(p2)'")) ) ///
            (model2b, label( TCRM_IPC Absorción) msymbol(T) mlabcolor("`r(p3)'") mcolor("`r(p3)'") mlabposition(2) ciopts(recast(rcap)  lcolor("`r(p3)'")) ) ///
            (model2bc, label( TCRM_IPC Brecha) msymbol(T) mlabcolor("`r(p4)'") mcolor("`r(p4)'") mlabposition(2) ciopts(recast(rcap)  lcolor("`r(p4)'")) ) ///
                (model3bc, label( TCRM_IPC completo) msymbol(T) mlabcolor("`r(p5)'") mcolor("`r(p5)'") mlabposition(2) ciopts(recast(rcap) lcolor("`r(p5)'")) ) /// 
              (model4, label( TCRM_PX ) msymbol(S) mlabcolor("`r(p1)'") mcolor("`r(p1)'") mlabposition(2) ciopts(recast(rcap) lcolor("`r(p1)'"))) ///
            (model5, label( TCRM_PX Estabilidad) msymbol(S) mlabcolor("`r(p2)'") mcolor("`r(p2)'") mlabposition(2) ciopts(recast(rcap)  lcolor("`r(p2)'"))) ///
            (model4b, label( TCRM_PX Absorción) msymbol(S) mlabcolor("`r(p3)'") mcolor("`r(p3)'") mlabposition(2) ciopts(recast(rcap)  lcolor("`r(p3)'"))) ///
            (model4bc, label( TCRM_PX Brecha) msymbol(S) mlabcolor("`r(p4)'") mcolor("`r(p4)'") mlabposition(2) ciopts(recast(rcap)  lcolor("`r(p4)'"))) ///
                (model5bc, label( TCRM_PX completo) msymbol(S) mlabcolor("`r(p5)'") mcolor("`r(p5)'") mlabposition(2) ciopts(recast(rcap) lcolor("`r(p5)'"))) /// 
              (model6, label( TCRM_PXULC ) msymbol(O) mlabcolor("`r(p1)'") mcolor("`r(p1)'") mlabposition(2) ciopts(recast(rcap) lcolor("`r(p1)'"))) ///
            (model7, label( TCRM_PXULC Estabilidad) msymbol(O) mlabcolor("`r(p2)'") mcolor("`r(p2)'") mlabposition(2) ciopts(recast(rcap)  lcolor("`r(p2)'"))) ///
            (model6b, label( TCRM_PXULC Absorción) msymbol(O) mlabcolor("`r(p3)'") mcolor("`r(p3)'") mlabposition(2) ciopts(recast(rcap)  lcolor("`r(p3)'"))) ///
            (model6bc, label( TCRM_PXULC Brecha) msymbol(O) mlabcolor("`r(p4)'") mcolor("`r(p4)'") mlabposition(2) ciopts(recast(rcap)  lcolor("`r(p4)'"))) ///
                (model7bc, label( TCRM_PXULC completo) msymbol(O) mlabcolor("`r(p5)'") mcolor("`r(p5)'") mlabposition(2) ciopts(recast(rcap) lcolor("`r(p5)'"))) ,  keep(ltcrmcpix ltcrmpx ltcrmpxulc) ///
        mlabel format(%9.3g)  mlabposition(12)  xtitle(Elasticidad precio) legend( cols(5) size(vsmall) region(margin(zero) lstyle(none))) yscale(off) xline(0)  ///
                name(tcrm_cifinal) levels(95)

I expect to have something like this

enter image description here

I need help with the design/layout of a graph. I expect an answer with a specific option to solve it.

1

There are 1 answers

1
flora93 On

I finally solved the problem. When using coefplot, for the coef plotted to be symmetrically and not overlap each other, we need to add rename() in the code. You can add as many arguments in rename as you wish, without any separator. To the code above I added at the final line:

rename(ltcrmcpix=reer ltcrmpx=reer ltcrmpxulc=reer)

The result is here enter image description here