Announcement

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

  • Marginal effects in probit/logit and OLS model with interaction terms

    Dear Statalist,

    Having searched the internet trying to understand how marginal effects work in a model with interaction terms, still does not give me full clarity.
    If I integrate interaction terms in my models (OLS, logit and bivariate probit) in order to find group differences, I can easily graph my results by using "marginsplot" after the margins command with the -at- option. This works perfectly and gives me the desired results.
    If I want to interprete the coefficient and the marginal effect of the component terms of the interaction I am puzzled about the interpretation. What does the coefficient and the marginal effect stand for? What if these have different signs (+/-) for the same variable?

    Any help is very much appreciated!!!

  • #2
    If I want to interprete the coefficient and the marginal effect of the component terms of the interaction I am puzzled about the interpretation. What does the coefficient and the marginal effect stand for? What if these have different signs (+/-) for the same variable?
    I think to get useful advice on this you need to show the exact commands you ran and the exact output Stata gave you that you are trying to interpret.

    That said, in an interaction model with a term like i.A#i.B (or i.A##i.B), the marginal effects of A and B separately do not exist. Rather, A has several marginal effects, depending on the values of B, and B has several marginal effects depending on the values of A. These can be exhibited with the following commands:
    Code:
    margins A, dydx(B)  // MARGINAL EFFECTS OF B AT ALL VALUES OF A
    margins B, dydx(A) // MARGINAL EFFECTS OF A AT ALL VALUES OF B
    Note that for the non-linear models (logit and probit), the results shown above are, themselves, actually averaged over an infinite range of marginal effects that depend on all the other variables. It may be more useful to make those marginal effects even more specific by constraining them with -at()- options.

    All of that said, it is better to post back with the actual commands and output so somebody can just check that there isn't some mistake along the way.
    Last edited by Clyde Schechter; 08 May 2017, 16:10.

    Comment


    • #3
      Thanks Clyde!
      I do understand your explainations so far.
      Code:
      * For the logit part my commands look like this:
      svy: logit y c.A##i.B $xvars
      margins, dydx(*)  //To have all marginal effects for all variables in the model to present in a table
      margins i.B, at (A = (0.6(0.1)1.3))
      marginsplot, noci // To have a nice graph of the effects of the two interacted variable
      
      * for OLS these commands are analogous:
      svy: reg y c.A##i.B $xvars
      margins, dydx(*)  //To have all marginal effects for all variables in the model to present in a table
      margins i.B, at (A = (0.6(0.1)1.3))
      marginsplot, noci // To have a nice graph of the effects of the two interacted variable
      Executing this, gives me coefficients, marginal effects and predictive margins of B on A. Now I have problems interpreting the first two for the component terms of the interaction A and B and c.A##i.B in the logit case, or is there a mistake along the way?

      Further, for there are variables that have a positive (negative) sign for the coefficient and a negative (positive) sign for the marginal effect. This does not seem to make any sense?

      You find my Stata output in the pictures attached.
      Attached Files
      Last edited by Kerstin Schmidt; 09 May 2017, 00:32.

      Comment


      • #4
        Your -margins- commands are not appropriate for an interaction model. Because of the interaction with r_estrato, you need to generate separate marginal effects for each level of r_estrato. So the code should be:

        Code:
        margins r_estrato, dydx()
        This will give you the marginal effects of each predictor variable (other than r_estrato itself) at each of the four values of r_estrato.

        After running that, I suggest you post back and show the full results of both the -logit- and -margins- outputs. Then we can look and see if there are any inconsistencies. What you show is very limited and does not illustrate the problem you are concerned about. That said, it is not necessarily a problem to have a positive coefficient and a negative marginal effect when working with an interaction model, especially when, as here, it is non-linear. But let's assess that after we have a look at the full output.

        Please read FAQ #12 for good advice on how best to post Stata code and output: in particular, the use of screenshots is discouraged. Copying from the Results window or your log file into this forum between code delimiters (explained in FAQ #12) is the preferred way. While you're there, pay attention also to the information about the -dataex- command, which you may someday need in order to post example data (though example data does not seem to be needed for this thread, at least not so far.)

        Comment

        Working...
        X