Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with displaced coefficients using -coefplot-

    Dear Statalisters,
    I want to plot regression coefficients using the Stata journal command -coefplot-. Unfortunately, I get displaced coefficients, in relations to the x-axis values when doing so.

    My panel data look like this:
    id year gini treatment
    1 1500 0.6 1
    1 1525 0.65 1
    2 1475 0.5 0
    2 1500 0.51 0
    3 1550 0.8 1
    3 1575 0.78 1
    I execute 2 two regressions using the -xtreg- command and I store the estimates.
    Code:
    xtreg gini ib1475.yearineq25 /*
    */ if localities_schmalkwar150==1 & treat_schmalkwar150==1 & yearineq25 >=1475 & yearineq25 <=1600, fe vce(cluster IDlocality)
    estimates store schmalkwar_treat
    Code:
    xtreg gini ib1475.yearineq25 /*
    */ if localities_schmalkwar150==1 & treat_schmalkwar150==0 & yearineq25 >=1475 & yearineq25 <=1600, fe vce(cluster IDlocality)
    estimates store schmalkwar_control
    Then I use the estimates to plot the coefficients, using the -coefplot- command:
    Code:
    label var yearineq25 year
    coefplot (schmalkwar_treat, label(Gini-change treatment group)) (schmalkwar_control, label(Gini-change control group)), /*
    */title(Locality-FE) xline(2.75) vertical drop (_cons) plotregion(fcolor(white)) /*
    */ xlabel(, angle(45) labsize(small)) ylabel(0(0.02)0.15) yscale(range(0(0.02)0.15)) /*
    */ recast(connected) noci graphregion(fcolor(white))
    My problem is that in the resulting graph, the point estimates are not entered over the values on the x-axis. The points of the blue line are displaced to the left and the points of the red line are displaced to the right with respect to the values on the x-axis. I enclose a picture.
    What can I do so that the red and blue points are entered over the x-axis values?

    Many thanks
    Click image for larger version

Name:	DiD Schmalkwar trends 1475-1600_15032020_v1.png
Views:	1
Size:	86.8 KB
ID:	1541963



    Last edited by Felix Schaff; 19 Mar 2020, 09:48.
Working...
X