Announcement

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

  • Interpreting interaction effects in a linear-log model

    Hi,

    I am running the following regression

    Code:
     reg LP_growth lnLP_5 lnDVAR_5 LPxDVAR i.x i.year#(i.ind i.CC2), vce(robust)
    LP_growth = labor productivity growth in percentages
    lnLP_5 = is the natural logarithm of initial labor productivity
    ln_DVAR_5 = is the natural logarithm of the domestic value added in production-ratio (this is thus a value between 0 and 1)

    And where
    Code:
    LPxDVAR
    is:
    Code:
    gen LPxDVAR = lnLP_5*lnDVAR_5
    Code:
    i.x
    are country-industry fixed effects,
    Code:
    i.year#(i.ind i.CC2)
    are country-year and industry-year fixed effects.

    My question: how can I interpret the interaction effect
    Code:
    LPxDVAR
    The coefficient that I get for this is 0.381.

    (have read the FAQ and hope this post is correct, my apologies if not)

    Thanks a lot!
    Willemijn
    Last edited by Willemijn Jonkheer; 29 Nov 2016, 07:01.

  • #2
    So you can think of this model as saying that the coefficient of log LP_5 depends on log DVAR. This interaction coefficient means that a unit increase in log DVAR (i.e. a multiplicative increase in DVAR itself by a factor of e) is associated with a 0.381 unit increase in the coefficient of log LP_5.

    Note that you can make life easier for yourself by using factor variable notation for these continuous variables as well (-help fvvarlist-) and re-running your regression as
    Code:
    reg LP_growth c.lnLP_5##c.lnDVAR i.x i.year#(i.ind i.CC2), vce(robust)
    Then you can use -margins- to calculate marginal effects and plot graphs--which is a much better way to understand your model than any amount of words trying to explain the coefficient of an interaction between two continuous variables.

    Comment


    • #3
      Thank you very much! Insightful, and I'll surely try -margins-.

      Comment


      • #4
        Hi! An additional question that came up during the revision of my paper:

        I am now running the following regression:

        Code:
         reg LP_growth c.lnLP_5##c.lnDVAR i.x i.year#(i.ind i.CC2), vce(robust)
        as Clyde suggested.

        Now, I would like to calculate the marginal effect of the
        Code:
        lnDVAR
        , but of course also including the interaction effect, as the effect appears conditional on
        Code:
        lnLP_5
        How can I do this with - margins - ?

        Should I just type:
        Code:
        margins lnDVAR
        and will Stata then include the interaction effect automatically?

        Or do I need to specify the -margins- command in a different way?

        This is what I understand from older posts.

        Thank you in advance.

        Comment


        • #5
          Addition:

          When I try:
          Code:
          margins lnDVAR
          The following error returns:
          factor variables may not contain noninteger values r(452);

          I am confused as to whether I should calculate the "total" marginal effects for
          Code:
           reg LP_growth c.lnLP_5##c.lnDVAR i.x i.year#(i.ind i.CC2), vce(robust)
          because the effects of -lnLP_5- and -lnDVAR- are mutually dependent, or if I should calculate the marginal effect only for -lnDVAR- (including the interaction effect), as this is my main variable of interest and I would like to dissect its marginal effect.

          For both options, I cannot find the right command after - margins- (i.e. which variables should I specify and how?)

          Many thanks!
          Willemijn

          Comment


          • #6
            In using a model with interaction, you are stipulating that there is no such thing as "the" effect of lnDVAR. Rather, as you have noted in your posts, lnDVAR's effect is conditional on the value of lnLP_5. So you've got the concept right, but it appears you are struggling with the syntax of -margins- with continuous variables. Your command -margins lnDVAR- fails because only discrete variables can appear in the varlist of -margins-. Continuous variables have to, instead, appear inside an -at()- option to specify values at which they are evaluated. And any variable whose marginal effect (conditional on what is specified in the -at()- option) you want has to be in the -dydx()- option

            So the first task is to decide at which values of lnLP_5 you want to know the corresponding marginal effect of lnDVAR. There might be a couple of values of lnLP_5 that are particularly meaningful and important in this respect and you might select them. Alternatively, you might want to see the marginal effects of lnDVAR at a range of values of lnLP_5 that roughly span the range of values lnLP_5 takes on in the data. For the purposes of illustrating the syntax, I'm going to assume that the "interesting" values of lnLP_5 are 1, 2, and 3. Then the command would be:

            Code:
            margins, dydx(lnDVAR) at(lnLP_5 = (1 2 3))
            If you would like a nice graph of those results, follow that command immediately by -marginsplot-. Note that -marginsplot- also allows essentially all options available in -graph twoway- and also has a number of options of its own, so you can customize the graph pretty much any way you like.

            Note that if you have a large set of values of lnLP_5 that are of interest, you can use standard Stata numlist syntax to abbreviate them rather than type them out one by one in the at() option.

            You can also run the command -margins, dydx(lnDVAR)- without specifying any values of lnLP_5. In that case Stata will calculate an average marginal effect of lnDVAR, averaged over the observed values of lnLP_5 in your sample. That figure may or may not be interesting or useful in your context--in most situations with interaction models, that figure is not useful, as the whole point is to model the heterogeneity of effect.

            Comment


            • #7
              Thank you very much, very insightful once again.

              The command works just fine and my -marginsplot- looks as it should right now.

              Again, many thanks for your time.

              W.

              Comment

              Working...
              X