Announcement

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

  • margins after logit

    Dear All,

    I think this point was addessed in the forum but I was not able to find anything. Suppose I have the following:

    Code:
    webuse margex, clear
    generate female=(sex==1)
    generate agefem=age*female
    
    logit outcome c.age##i.female, nolog
    margins, dydx(age) at(female=(0 1)) post
    
    logit outcome age female agefem
    margins, dydx(age) at(female=(0 1)) post
    Why the estimation of marginal effect changes slightly if i use factor notation instead of constructing the interaction term manually?

    Thanks for your help.

    Best

    Dario

  • #2
    In the first setting, Stata calculates the margin based on coefficients of age itself and age*female. In the second case, Stata only looks at the coefficient of age because it treats agefem just as a different variable even though we know it relates to age.

    Comment


    • #3
      For a more detailed explanation, see

      https://www3.nd.edu/~rwilliam/stats/Margins01.pdf
      -------------------------------------------
      Richard Williams
      Professor Emeritus of Sociology
      University of Notre Dame
      StataNow Version: 19.5 MP (2 processor)

      EMAIL: [email protected]
      WWW: https://academicweb.nd.edu/~rwilliam/

      Comment


      • #4
        Richard Williams and Fei Wang Thanks for your explanation. I read with a gread interest Richard's presentation. Very useful!

        Comment

        Working...
        X