Announcement

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

  • Interaction terms in fixed-effects model

    Hello,

    I am writing to ask a question about interaction terms in fixed-effects model.

    I simplify my estimation model as follows:

    Y = X1 + X2 + X1*X2 + firm fixed effects, where X1 is the variable of interest.

    With fixed-effects, I could interpret the coefficient of X1 as the expected change in Y associated with one unit change in X1 within firm.
    I believe I could also infer whether within-firm variations in X2 has a mitigating or enforcing effect of X1 on Y, depending on the side of the interaction term. Is this a correct interpretation?

    I also want to find out whether cross-sectional variations in X2 have a mitigating or enforcing effect of X1 on Y. Is it possible to do this using xtreg?

    Thank you very much.


    Last edited by Leigh Yao; 28 Mar 2015, 07:43.

  • #2
    In a model containing interaction terms it is not true that the coefficient of X1 is the expected change in Y associated with one unit change in X1. It is the expected change in Y associated with one unit change in X1 conditional on X2 = 0. As such, the coefficient of X1 may or may not be of any interest. In particular, if 0 is not in the range of meaningful values of X2, then the coefficient of X1 is an abstraction with no application to reality. For that reason (among others) it is common to center the variables of an interaction around their means, or medians, or other meaningful values, so that the coefficients of the main effects make some sense.

    The coefficient of the interaction term tells you how much effect X2 has on the effect of X1 on Y. If the interaction coefficient is positive, then the effect of X1 on Y increases as X2 increases, if negative the opposite. If the interaction coefficient is zero, then the effect of X1 on Y is independent of X2.

    All of the above is true in any regression model, not just fixed effects. The fixed-effects don't really change anything, except that if one of the variables, say X2, is constant within each firm, the X2 main effect will be collinear with the fixed effects and will be automatically dropped from the regression.

    Yes, you can do all this in -xtreg-. Remember to create the interaction term using factor variable notation (see help fvvarlist for how).

    Comment


    • #3
      Thanks Clyde! I realized that my initial post wasn't precise. Thanks for pointing them out.

      Initially, I estimated the model Y=X1+X2+X1*X2 in a pooled regression, and the interpretation of the interaction term is fairly straightforward.

      Later on, I estimated the model using fixed-effects in order to control for time invariant unobserved heterogeneity. Then my understanding becomes murkier.

      In the regression Y = X1+X2 + firm fixed-effects, my understanding is that the coefficient of X1 or X2 reveals the expected change in Y associated with one unit of within-firm change in X1 or X2, all else equal.

      With interaction terms Y= X1 + X2 + X1*X2 + firm fixed-effects, I understand that the effect of X1 on Y increases as X2 increases if the interaction coefficient is positive. However, does this mean, the effect of X1 on Y increases as X2 increases within-firm?

      In my example, X2 has small within-firm, but large across-firm variations. And what I ultimately wanted to to show is how the effect of X1 on Y changes as X2 changes across-firm, while (if possible) still controlling for time invariant unobserved heterogeneity. I am not sure which STATA routine to use.

      Any help would be appreciated.

      Thanks again.








      Comment


      • #4
        In the regression Y = X1+X2 + firm fixed-effects, my understanding is that the coefficient of X1 or X2 reveals the expected change in Y associated with one unit of within-firm change in X1 or X2, all else equal.
        That's correct.

        With interaction terms Y= X1 + X2 + X1*X2 + firm fixed-effects, I understand that the effect of X1 on Y increases as X2 increases if the interaction coefficient is positive. However, does this mean, the effect of X1 on Y increases as X2 increases within-firm?
        Yes, everything in a fixed effects regression estimates within-firmparameters.

        In my example, X2 has small within-firm, but large across-firm variations. And what I ultimately wanted to to show is how the effect of X1 on Y changes as X2 changes across-firm, while (if possible) still controlling for time invariant unobserved heterogeneity. I am not sure which STATA routine to use.
        Look at -xtreg, be-. There is a pretty full and clear discussion of the various -xtreg- estimators in the users manual in the -xtreg- section starting on page 366.

        Comment


        • #5
          Hi Clyde,

          All of the above is true in any regression model, not just fixed effects. The fixed-effects don't really change anything,
          I recently came across

          Giesselmann, M., & Schmidt-Catran, A. W. (2018). Interactions in fixed effects regression models. Sociological Methods & Research

          who show that in the fixed effects framework, "it is generally considered wrong to operationalize an interaction between two time-varying variables by taking the product of their individual-demeaned forms. Instead it is recommended to use a double-demeaned form to get a genuine within estimator."

          I am wondering whether this extra demeaning would change anything in the interpretation of the interaction or the marginal effect of one of the variables.

          Best regards, Marco

          Comment


          • #6
            Good question. I don't have access to that paper, but I think I understand what you (it) are saying. It appears that Stata takes care of this appropriately. Run this:

            Code:
            clear*
            
            webuse nlswork
            
            xtreg ln_wage i.union##i.msp, fe
            estimates store one
            
            gen umsp = union*msp
            
            foreach v of varlist union msp umsp {
                by idcode, sort: egen mean_`v' = mean(`v')
                gen `v'_dm = `v' - mean_`v'
                drop mean_`v'
            }
            
            
            xtreg ln_wage union_dm msp_dm umsp_dm, fe
            estimates store three
            
            by idcode, sort: egen mean_umsp_dm = mean(umsp_dm)
            gen umsp_ddm = umsp_dm - mean_umsp_dm
            drop mean_umsp_dm
            
            xtreg ln_wage union msp_dm umsp_ddm, fe
            estimates store four
            
            esttab one three four
            You will see that you get the same result, except for minor difference in the constant term, each way.

            By the way, I do know how to count. The reason there is no "two" in my series of estimates is that I at first included a version of the regression which used factor variable notation on the de-meaned variables. But, of course, that won't run because the demeaned versions are no longer non-negative integer values. So I deleted that and didn't bother to renumber the others.

            Comment


            • #7
              Thank you Clyde, is there a way I can make sure that Stata takes care? I did not find any hint in the manual. I further tried to re-estimate those models with reg instead of xtreg (facing some additional problem with xtreg's grand mean). I mean, I would be interested to find an actuall difference. When we assume Stata handles FE-interactions with double-demeaning, shouldn't there be differences between "three" and "four" anyway? Best regards, Marco

              Comment


              • #8
                I don't expect to see a difference between three and four. Or, rather, I would expect that difference to show up only in the constant term, which is exactly what happens.

                Comment


                • #9
                  Hi Clyde,

                  With due respect, I think the paper means something else. With regard to the code, if the variable is de-meaned twice it is the same as de-meaning it once because the mean is already zero. The small changes in the constant term are due to Stata rounding error.

                  Best, Liaoliang

                  Comment


                  • #10
                    Yes, that is correct. The single and double-demeaned variables are, when calculated in double precision, almost exactly equal, and are equal to within float precision. So there are some small rounding errors and they should account for the constant terms' differences.

                    As for whether I am misunderstanding the paper, I was, and stall am, unable to access it, so I am relying only on what O.P. described.

                    Comment

                    Working...
                    X