Announcement

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

  • Marginsplot - [Marginal effect of x on y] on y axis

    Hi all,

    I am testing moderation effect in my paper and want to plot marginal effect.

    Let's say
    Dependent variable: Y
    Independent variable: X
    Moderator: Z
    I am using negative binomial regression.

    I found ways to plot the graph where y axis is negative binomial prediction and x axis is Z(moderator). All information I found was on how to plot this type of graph.
    However, I would like to plot a graph where y axis is marginal effect of X on Y and x axis is Z

    I found two articles that plot just like this.
    - Paolella, Lionel, and Rodolphe Durand. "Category spanning, evaluation, and performance: Revised theory and test on the corporate law market." Academy of Management Journal 59.1 (2016): 330-351. (e.g., page 343)

    - Jensen, Michael, and Pengfei Wang. "Not in the same boat: How status inconsistency affects research performance in business schools." Academy of Management Journal 61.3 (2018): 1021-1049. (e.g., page 1038)



    Can anyone help me with this?

    Thanks in advance.

  • #2
    If I understand you correctly, and assuming that Z is a continuous variable, you need to specify a range of values of Z that you are interested in doing this graph for. Let's say, for sake of illustration, that you want to plot this graph with Z ranging between 1 and 5.

    [code
    nbreg Y c.X##c.Z // PERHAPS OTHER VARIABLES AS WELL, PERHAPS SOME OPTIONS
    margins, dydx(X) at(Z = (1(.2)5))
    marginsplot
    [/code]
    Note: I picked a 0.2 step between 1 and 5 arbitrarily. It should provide enough points that even if there are interactions with several other variables in the model complicating things, you will get a reasonably smooth graph. If Z doesn't interact with anything else and there are no quadratic or higher order terms, then the marginal effect of X on Y is actually a linear function of Z and you can just use -at(Z = (1 5))- to get the graph quicker.

    Comment


    • #3
      Thanks for the reply, Clyde. I tried the code, but I am a little bit confused. The model I am using is [xtgee, family (nbionmial) link(nbinomial)]. The y axis now is "Effects on Negative Binomial Prediction", but the values are all negative (the entire range of moderator). If y axis now means marginal effect of X on Y, then how can it be negative value? From the articles I cited above, they interpreted negative values of marginal effect on some range of moderator as being insignificant. Of course, my model has significant effect of X and X*Z (and Z).

      Comment


      • #4
        There is no reason a marginal effect can't be negative. It means that increasing X is associated with decreasing Y.

        If you would like specific advice in understanding your results, you need to show them. (See Forum FAQ #12 for information about the preferred ways to show code and output.)

        Comment


        • #5
          Click image for larger version

Name:	Graph.png
Views:	1
Size:	12.3 KB
ID:	1460484



          Here is the graph. What's still confusing me is that the coefficients for X and X*Z are both negative and significant. But the graph looks like Z is reducing the negative effect of X? Thanks.

          Comment


          • #6
            So as Z increases, the graph shows the marginal effect of X increasing towards 0. This does not, at first glance, seem consistent with the coefficient of Z#X being negative (significance is irrelevant here). However, the use of a negative binomial regression, which is itself non-linear, complicates things. I think that to get a full understanding of what is going on, we need to look at the actual -nbreg- and -margins- commands you used and the output from both. Please post back with those. (Be sure to use code delimiters when posting your commands and output so they will align in a readable way. See FAQ #12 if you are not familiar with code delimiters. Also, please show the exact results that Stata gave you as output from the commands: copy them from the Results window or your log file and past them into the Forum editor. Do not edit in any way, and do not show results that have been past through -estout- or -outreg- or other such programs.)

            Comment

            Working...
            X