Announcement

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

  • logit and margins

    Dear All,

    I use the dataset margex and the command margins in order to replicate an example I saw in a paper. I use:

    Code:
    webuse margex
    gen female=(sex==1)
    logit outcome c-age##i.female
    I got the following result:

    Click image for larger version

Name:	res.png
Views:	1
Size:	28.4 KB
ID:	1475310


    Then I use:

    Code:
    margins, dydx(age female) post
    And this is the result:

    Click image for larger version

Name:	res2.png
Views:	1
Size:	28.5 KB
ID:	1475311


    Then I try to re-estimate the model above using:

    Code:
    gen femage=female*age
    logit age female femage
    I obtain the same results I got above. However, when I use:

    Code:
    margins, dydx(age female)
    I got:

    Click image for larger version

Name:	res3.png
Views:	1
Size:	24.3 KB
ID:	1475312


    Why do I have such a difference in the estimation of margins? I have a very vague idea about a thread in this forum regarding such a difference, but I might be wrong. Any suggestion?

    Thanks in advance

    Dario

  • #2
    The second results are incorrect, and the reason is that interaction terms need special handling when calculating marginal effects or predictive margins. And when you make a "home brew" interaction variable like femage, Stat's -margins- command has no way of knowing that it's an interaction. So it treats it just like any other unrelated variable. -margins- can only identify interaction variables, and treat them appropriately, when you use factor variable notation, which you did in the first go around, but not the second.

    Comment


    • #3
      Thanks for your explanation Clyde.

      Comment

      Working...
      X