Announcement

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

  • Why marginal effects and the graph of the interaction term differ?

    Dear all,
    I’m using a panel probit model and need to report marginal effects and a graph that shows how the dependent variable changes is dependent on two continuous variables and their interaction term.
    Y = constant + X1 + X2 + X1*X2 + error
    However, the marginal effects and the graph are contradictory. On the one hand, marginal effects of two continuous variable X1*X2 is significantly positive, and individually X1, X2 are significantly positive. The command I used was:
    . margins, dydx(*)
    The marginal effects of the interaction term is calculated by:
    .margins, expression(normalden(xb())*(_b[X1] + X2*_b[c.X1#c.L_X2])) dydx(X2)
    Graph:
    X1 on the x-axis, predicted probability of Y=1 on the y-axis.
    . margins, at(X1=(0(0.5)3) X2=(2 4 6))
    . marginsplot, noci
    The graph shows two strange things:
    1. As X1 increases, the predicted probability of Y=1 is decreasing. This is strange because the individual effect of X1 and its interaction with X2 are significantly positive. So I’d expect that as X1 increases, the probability of Y=1 with increase.
    2. At the same of level of X1, higher X2 has lower predicted probability of Y=1. This is strange because X2 on its own and its interaction with X1 is significantly positive. So what I get should be at the same level of X1, higher X2 will have higher predicted probability of Y=1.
    My question is why margins and the graph show contradictory results?
    Can the marginal effect of the interaction term and the graph contract each other? Something must be wrong here!



  • #2
    There is no such thing as the marginal effect of an interaction term. The interaction term has a coefficient in the model, of course, but it cannot be interpreted as a marginal effect. Only its constituent effects ("main" effects) have marginal effects, and those marginal effects, as you clearly show you recognize, are always conditional on the values of the other.

    That said, your description of the results you are getting does sound odd. But without actually seeing the regression command, the regression output, the -margins- and -marginsplot- commands you actually used, and the output of those, it really isn't possible to figure out what's going on.

    Comment


    • #3
      Thank you very much for your reply Clyde. I understand your point. The way to specifically calculate the marginal effects of the interaction term and interpretation of this follows this link:
      https://blog.stata.com/2016/07/12/ef...-interpreting/

      My previous question was unclear, and please let me re-phrase my question. The dependent variable is a dummy, and I have two continuos variables var1 and var2 and their interaction terms, plus several other explanatory variables. What I need is to have a graph showing how predicted probability of Y= 1 changes with different levels of var2 in a range of var1. Here is my command:

      . probit y c.var1##c.var2 Z1 Z2

      . margins, at(var1=(0(0.05)0.3) var2=(0.5 1 1.5))

      . marginsplot, noci

      Given it's a non-linear model, I'd expect to have a non-liner relationship between the predicted probability of Y= 1 and var1 at different values of var2, but what I get is a liner prediction, as the attached graph shows.
      I've also tried the marginscontplot command,
      .marginscontplot var1 var2, margopts(predict(pr)) at1(0(0.05)0.3) at2(0.5 1 1.5)
      and also shows a linear relationship.

      I cannot figure out why this is the case and if I've made some mistakes.... Any comments would be much appreciated. Thank you very much.
      Best wishes,
      Meng
      Attached Files

      Comment


      • #4
        I think the non-linearity is there, but that it is too subtle to see with the eye. What strikes me about your graph is that the predicted probabilities range from a little below 0.012 to just above 0.018. The probit curve (also called the normal ogive) is very flat in that region. To see a curvilinear response you need to be in the area of probabilities where probit curve is itself noticeably non-linear. That would be for predicted probabilities around .05 to .3 and .7 to about .95. At the extremes near probabilities of 0 and 1, or in the very middle near 0.5 the probit curve is almost linear (flat at the extremities, steep in the middle).


        Comment


        • #5
          Thank you very much Clyde for enlightening me. I understand your point that the predicted probabilities may to too small to see any non-linear relationship. I'll find out what I can do next. Many thanks indeed.
          Best wishes,
          Meng

          Comment

          Working...
          X