Announcement

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

  • Interaction Terms in a Hausman-Taylor Model

    Hi,

    I am using the Hausman-Taylor estimator in Stata 14.0. I need to use an interaction term to understand how the performance of respondents from different groups varies over time. When I ran xthtaylor, I got an error - "interactions not allowed". Is there a way to use an interaction term with 'xthtaylor' in Stata?

    Thanks,
    N

  • #2
    Nik:
    welcome to this forum.
    You should create interaction by hand.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      It looks like xthtaylor allows the old -xi:- expansion operator (see help xi).

      Code:
      *So, instead of
      xthtaylor ... i.factorvar1##c.continuous_var ... i.factor_var2##i.factor_var3
      
      *use
      xi: xthtaylor ... i.factor_var1*continuous_var...i.factor_var2*i.factor_var3
      But know that if you used the expansion operator for a variable in one part of the equation, you need to do the same in the others:

      This will give you an error:
      Code:
      xi: xthtaylor lwage wks i.south*ed smsa ms exp exp2 occ ind i.union*i.fem blk, endog(exp exp2 occ ind union ed) constant(fem blk ed)
      This will work:
      Code:
      xi: xthtaylor lwage wks i.south*ed smsa ms exp exp2 occ ind i.union*i.fem blk, endog(exp exp2 occ ind i.union ed) constant(i.fem blk ed)
      Stata/MP 14.1 (64-bit x86-64)
      Revision 19 May 2016
      Win 8.1

      Comment


      • #4
        Thank you, Carlo!

        Thanks, Carole J. Wilson! I have worked it out and have the results now.

        Comment

        Working...
        X