Announcement

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

  • Logit: illustrating interaction effects

    Dear Statalist,

    I am using Stata 14.2 with Windows 10. I have a logit model on partner acquisition in venture capital, the dependent variable being cooperation (binary, 1 if a partner was chosen and zero otherwise). My main variable of interest is PARTNER_equityinv (the dollar amount of a potential partner's equity invested over the last ten years), which I interacted with the variale PARTNER_local (binary, 1 if the partner is from the same nation and zero otherwise), the interaction term being P_equityinv_PARTNERlocal, and the full logit model includes several controls.
    I would like to illustrate the effect of PARTNER_equityinv on the probability of cooperation, depending on whether or not the potential partner is local.
    Therefore, I used the following code and created a marginsplot (attached below):
    Code:
    Code:
     logit COOPERATION PARTNER_equityinv PARTNER_local P_equityinv_PARTNERlocal //followed by control variables
                 margins if PARTNER_local==1, at(PARTNER_equityinv==(0(500)15920)) dydx(PARTNER_local) vsquish level(95)
                 marginsplot
    The plot I created shows the average marginal effects of PARTNER_equityinv on the probability of cooperation for PARTNER_local==1 (am I right?), and I would now like to create a plot that also has a second line for the effect of PARTNER_equityinv on the probability of cooperation for PARTNER_local==0, i.e. both cases in one plot, and possibly also show the frequency distribution of the variable PARTNER_equityinv in the background.

    Is there any possibility of getting such a plot from Stata?

    Thanks for your help!
    Best regards
    Carolin
    Click image for larger version

Name:	Plot_example.png
Views:	1
Size:	19.9 KB
ID:	1473977

  • #2
    No, your model is not compatible with using -margins- and the -margins- results are not what you think.

    The problem is that you used a "homebrew" interaction term P_equityinv_PARTNERlocal. -margins- has no way of knowing that this is actually the interaction of PARTNER_equityinv with PARTNER_local, so it treats it as if it were just another variable. Consequently the -margins- results are incorrect and should not be interpreted. In order to use -margins- you must use factor-variable notation in your regression. (Read -help fvvarlist-.)

    Your -margins- command is also problematic in conditioning on PARTNER_local = 1. I don't grasp why you are trying to do this separately for partner_local = 0 and partner_local = 1. While there are many different marginal effects of partner_local, as a function of partner_equityinv, because partner_local is a dichotomous variable, it does not have a separate marginal effect at its own values of 0 and 1. The marginal effect, in fact, is defined as the difference between the outcomes at partner_local = 0 and at partner_local = 1.

    Code:
    logit COOPERATION c.PARTNER_equityinv##i. PARTNER_local  //followed by control variables           
    margins, at(PARTNER_equityinv==(0(500)15920)) dydx(PARTNER_local) vsquish level(95)           
    marginsplot
    will enable -margins- to correctly estimate the average marginal effects of Partner_local at your specified values of partner equity.


    Comment


    • #3
      Dear Clyde,
      Thanks so much for your reply! I adjusted my model according to your advice, and got the plot below. A couple of points are still unclear to me:
      • In the Stata output it says "Note: dy/dx for factor levels is the discrete change from the base level" after calculating the marginal effects. Does that mean the plot shows the difference between the outcomes at partner_local=0 and partner_local=1, with zero being the base level, i.e. the plot is the impact of partner_equityinv for partner_local=1 relative to partner_local=0?
      And on the interpretation:
      • When interpreting the graph, would that mean, say, at partner_equityinv=7500 (in red) the impact of partner_equityinv is 50% lower if partner_local=1 relative o partner_local=0 (the base level)?
      • Further, I assume the results are only significant at very low levels of partner_equityinv and between values of 5000 and 10000 (in green), i.e. where the conficende bands don't intersect the zero-line at the x-axis?
      Click image for larger version

Name:	Plot_example1.png
Views:	1
Size:	11.6 KB
ID:	1474122





      Thanks so much and best regards
      Carolin
      Last edited by Carolin Helmreich; 09 Dec 2018, 16:01. Reason: Difficulty with uploading the plot

      Comment


      • #4
        Does that mean the plot shows the difference between the outcomes at partner_local=0 and partner_local=1, with zero being the base level, i.e. the plot is the impact of partner_equityinv for partner_local=1 relative to partner_local=0?
        Yes, exactly so.

        When interpreting the graph, would that mean, say, at partner_equityinv=7500 (in red) the impact of partner_equityinv is 50% lower if partner_local=1 relative o partner_local=0 (the base level)?
        No. The marginal effect is in absolute, not relative terms. So it is 50 percentage points lower, not 50 percent lower. Putting it concretely, if the probability is 70% when partner_local = 0, then when partner_local = 1, the probability is 20%, (not 35%).

        Further, I assume the results are only significant at very low levels of partner_equityinv and between values of 5000 and 10000 (in green), i.e. where the conficende bands don't intersect the zero-line at the x-axis?
        This is correct, but probably a useless fact. It is important to remember that, in any context, not statistically significant does not mean no effect. This is even more the case when dealing with interactions: you can see from your own graph that the confidence intervals very considerably in their width, so that "statistical significance" is a very different criterion depending on the value of Partner-equity. While you might well be interested in knowing whether the interaction term in the original logistic regression model achieves statistical significance, the range of values of a variable over which the marginal effect is statistically significant is usually a rather meaningless result. There isn't really anything special about that range of values.

        Comment


        • #5
          Dear Clyde,

          Thank you very much, this is extremely helpful and highly appreciated!

          No. The marginal effect is in absolute, not relative terms. So it is 50 percentage points lower, not 50 percent lower. Putting it concretely, if the probability is 70% when partner_local = 0, then when partner_local = 1, the probability is 20%, (not 35%).
          One last question on the interpretation of the marginal effect: is there any way of knowing and/or illustrating what the base-level probability, i.e. the probability at a certain point of partner_equityinv is for partner_local=0?

          Thanks a lot and best regards
          Carolin

          Comment


          • #6
            Code:
            margins PARTNER_local, at(PARTNER_equityinv==(0(500)15920))

            Comment


            • #7
              Thank you very much! Using your code I got the plot below.
              Just to check whether I interpret it correctly: it seems to me that the plot below shows the probability of cooperation based on partner_equityinv with two separate lines (one for partner_local=0 and one for partner_local=1). Is it true that the previous plot (above) combines the same information into one line (i.e. the difference)? That conclusion seems too easy, as the previous plot showed average marginal effects with the effects on the probability of cooperation on the y-axis, while this one shows predictive margins with the probability of cooperation on the y-axis. I have to confess that the difference among average marginal effects and predictive margins is not clear to me.
              One thing that makes me suspicious about the plot below is that points on the right hand side for partner_local=0 show a probablity of cooperation of almost 1. Even though these are outliers, that can hardly be true, as the effect size of partner_equityinv should be much smaller throughout the values for partner_equityinv.
              Click image for larger version

Name:	Plot_combined.png
Views:	1
Size:	19.5 KB
ID:	1474269

              Thanks a lot and best regards
              Carolin

              Comment


              • #8
                I have to confess that the difference among average marginal effects and predictive margins is not clear to me.
                I don't know what to make of this. In the sentences leading up to that you have set out in perfectly clear language the precisely correct interpretation of both the current graphs and the graph in your earlier post. So I don't grasp what it is you don't understand here--as far as I can see, you understand it perfectly. What am I missing here?

                One thing that makes me suspicious about the plot below is that points on the right hand side for partner_local=0 show a probablity of cooperation of almost 1. Even though these are outliers, that can hardly be true, as the effect size of partner_equityinv should be much smaller throughout the values for partner_equityinv.
                All the results that come out of -margins- and -marginsplot- are the calculated predictions of your model. If they are not realistic, it means that your model is wrong. (Well, of course, as Box noted, all models are wrong--but useful models that are approximately right exist.) So if probabilities close to 1 are implausible and have not been observed in the real world, then the model that you fit with logit just isn't a good specification of reality and you need to find a better one.

                In fact, all analyses of this type should include that kind of reality testing--so good for you for having done so instinctively. Having demonstrated that a simple logistic model of the kind you have fit makes outlandish predictions. You need to find a better model. Take a closer look at how the predicted values correspond to reality at other levels of PARTNER_equityinv. If the problem is mostly confined to higher levels, consider using a different specificaion of PARTNER_equityinv--perhaps a quadratic, or a linear or cubic spline, or maybe something else.

                Comment


                • #9
                  Dear Clyde,
                  Thanks so much for your swift response and your reassurance! Your help is extremely valuable!
                  Kind regards
                  Carolin

                  Comment

                  Working...
                  X