Announcement

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

  • IV with factor variables (interaction terms)

    Dear statalisters,

    I want to run the following regression

    regress logwage i.year##(c.cog)

    IVing for "cog" using "grade" as there is substantial measurement error in "cog". How can I do this swiftly without creating a separate variable for each year-cog combination and IVing each single one of them?

    Michael

  • #2
    Dear all,

    Are there no ideas of how to do this? I was trying something like

    ivregress 2sls logdeklon (i.year##c.cog = i.year##c.grade) if cog!=.

    which gives the error message "1991b.year included in both endogenous and excluded exogenous variable lists"

    Any suggestions at all?

    Michael

    Comment


    • #3
      What about

      Code:
      ivregress 2sls logdeklon i.year ( cog i.year#c.cog = grade i.year#c.grade) if cog!=.
      ## specifies that the factor variable list includes the both the levels of i.year and c.cog along with the interactions, and you want to instrument only the level of cog and the interactions, not the levels of year.


      Jorge Eduardo Pérez Pérez
      www.jorgeperezperez.com

      Comment


      • #4
        Perfect, that solves the problem. Thanks Jorge!

        Comment

        Working...
        X