Announcement

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

  • Margins combined with Coefplot

    Dear forum members,

    I have the following two models in simplified form, I would like to model the marginal effect of ysm and exp:

    Code:
    regress logwage i.ysm  urate  i.ysm#c.urate if immigrant==1
    Code:
    eststo margin1: margins, dydx(ysm)   post
    Code:
    regress logrhw i.exp urate i.exp#c.urate if immigrant==0
    Code:
    eststo margin2: margins, dydx(exp)   post
    First regression are immigrants only, ysm is years since migration in years: 0 (base), 1-2, 3-4, 5-6, 7-10, 11-20, 21-30 and urate is a continuous variable.
    Second regression are natives only, exp is experience in years: 0 (base), 1-2, 3-4, 5-6, 7-10, 11-20, 21-30 and urate is a continuous variable as before.
    Then, I would like to draw the graph as follows:
    Code:
    coefplot (margin1, msymbol(T) label(Immigrant)) (margin2, msymbol(S) label(Native)),  ylabel(0.2(0.1)2.5,format(%03.1f) angle(0)) vertical title("Change in Log-Wage, 95% C.I.") coeflabels(1._at = "1-2" 2._at = "3-4"  3._at = "5-6" 4._at = "7-10" 5._at = "11-20" 6._at= "21-30")
    Here is my problem, since ysm and exp are two different variables, I get two graphs next to each other, with two x axes next to each other. Since ysm and exp use the same scale, it would be wonderful to get one x axis with the graphs being on top of each other.

    I would once again highly appreciate your help.

    Thanks a lot,

    Nico
















Working...
X