Announcement

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

  • Is a Logarithmic interaction term possible?

    I am currently working on a gravity model, where I've taken the natural logarithm of my independent and dependent variables mainly to reduce data skewness. Now I want to add an interaction variable, but I am not sure whether I should interact the variables in their logarithmic form or interact them first in their original form and then take the natural logarithm of that multiplication. I couldn't find any information about this on google, so I hope someone in here can help me. I'll appreciate it a lot.

  • #2
    Because log(x*z) = log(x) + log(z), it makes no sense to form the interaction and then take the log. You are adding a perfect linear function of the two explanatory variables.

    Only log(x)*log(z) makes sense.

    JW

    Comment


    • #3
      Thank you very much, Jeff

      Comment


      • #4
        I have a similar question, but related to log difference for the interaction term. Say I set up the model:

        Y = B0+B1X1+B2X2+B3X1X2

        And need to transform the variables to log difference for Y and X1 only, with DlnX = lnX(t) - lnX(t-1):

        DlnY = B0+B1DlnX1+B2DX2+B3DlnX1*X2

        My question is about the last term. Should it be: (lnX1* X2)(t) - (lnX1* X2)(t-1), the first difference of their product or:
        Can I use: DlnX1 * DX2 = [(lnX1)(t) - (lnX1)(t-1)] * [X2(t) - X2(t-1)], the product of their first differences?

        Also, I'm not sure how to make sense of either in terms of their interaction's impact on their components's marginal impact on Y.

        Thanks for any help!

        Comment


        • #5
          The interaction term should always be the product of the actual constituent variables as they appear in the model. So in your case:

          Code:
          gen lnY = log(Y)
          gen lnX1 = log(X1)
          
          regress D.lnY D.c.lnX1##D.c.X2
          The interpretation of this interaction term is like the interpretation of any other interaction term. Its coefficient is the difference in the marginal effect of DlnX1 on DlnY associated with a unit difference in DX2. Or, equivalently, it is the difference in the marginal effect of DX2 on DlnY associated with a unit difference in DlnX1. Tracing this back a step, DlnX1 = ln(X1_t+1)-ln(X1_t) = ln(X1_t+1/X1_t), so it is also the difference in the marginal effect of DX2 on DlnY, associated with a multiplication of X1_t+1/X1_t by a factor of e = 2.718...

          One could go a bit farther, since Y has also been log transformed, if the interaction coefficient is b, then multiplying X1_t+1/X1_t by a factor of e is associated with multiplying Y_t+1/Y_t by a factor of exp(b). (If b is close to zero, exp(b) can be approximated by 1+b.)

          Last edited by Clyde Schechter; 21 Jul 2018, 22:09.

          Comment


          • #6
            Thank you so much, Clyde! This is very helpful.

            Comment

            Working...
            X