Announcement

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

  • Help with Using Lincom Command on Interaction Term

    Dear all,

    I am using Stata 16, on mac. I used the following command to estimate my regression: regress wage educ urban c.educ#urban. But I wanted to use the lincom command to see what would education be if a person lived in a rural area so I tried this command, lincom educ + 0.urban + 0.c.educ#urban and got the error invalid syntax. Can the lincom command be used on c.educ#urban?

    Thank you in advance for your help

    Jason Browen

  • #2
    urban = 0 for rural, right? So wouldn't the effect of education for people in rural areas just be the coefficient for education?

    In any event, I think you want coding like this:

    Code:
    webuse nhanes2f, clear
    clonevar wage = health
    clonevar urban = female
    clonevar educ = weight
    regress wage educ i.urban c.educ#urban
    * Effect of education for rural areas
    lincom educ + c.educ#0.urban
    * Effect of education for urban residents
    lincom educ + c.educ#1.urban
    In other words you aren't handling the interaction term correctly and you are putting the 0. in the wrong place.
    Last edited by Richard Williams; 03 Nov 2019, 13:42.
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    StataNow Version: 19.5 MP (2 processor)

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

    Comment


    • #3
      Ohhhh yeah! Thank you so very much for all of your help!

      Comment

      Working...
      X