Dear All,
I'm now conducting a negative binomial regression model for count dependent variable y, independent variable x1, x2, moderating variable m and control variable c1, c2. I want to make a simple slope test and draw a plot to see the moderating effect of m on the relationship between x1 and y. Is the code for the simple slope test same as the code for linear regression model? Like:
margins, dydx(x1) at(m=(-1,1))
And then use marginsplot to see the simple slope plot?
However, I'm confused about the result. If "a" is the coefficient for x1, "c" in the coefficient for the interaction term x1*m, then when m = -1, the simple slope should be a+c*(-1) = a-c. But why the simple slope calculated from the above code does not equal to a-c? Instead, the result from margins, eydx(x1) at(m=(-1,1)) is the same as a-c when m = -1.
How should I see the simple slope test and the plot?
Thanks in advance for any advice and help!!
Best,
Kelly
I'm now conducting a negative binomial regression model for count dependent variable y, independent variable x1, x2, moderating variable m and control variable c1, c2. I want to make a simple slope test and draw a plot to see the moderating effect of m on the relationship between x1 and y. Is the code for the simple slope test same as the code for linear regression model? Like:
margins, dydx(x1) at(m=(-1,1))
And then use marginsplot to see the simple slope plot?
However, I'm confused about the result. If "a" is the coefficient for x1, "c" in the coefficient for the interaction term x1*m, then when m = -1, the simple slope should be a+c*(-1) = a-c. But why the simple slope calculated from the above code does not equal to a-c? Instead, the result from margins, eydx(x1) at(m=(-1,1)) is the same as a-c when m = -1.
How should I see the simple slope test and the plot?
Thanks in advance for any advice and help!!
Best,
Kelly
Comment