# Regression with Quadratic Term - Understanding Marginal Effect

I am working with a regression with an x and x squared predictors. The equation is:

-0.0104x + (-0.00002)x^2.

I understand the marginal effect is calculated by differentiating to:

-0.0104 + 2(-0.00002)x, and that the ME is calculated generally at the mean of x.

However, I was also taught that given an x such as 10, one can simply insert 10 in the equation, so that y hat when x is 10 is -0.0104(10) + (-0.00002)(100).

Doing so, I get -0.106. But the marginal effect at 10 is -0.0108.

So there are two values: -0.106, and -0.0108. What is the interpretation of the first value, given the second value is the marginal effect. Is it correct that the marginal effect represents the slope of the inverse parabola at point x=10?

• "* the ME is calculated generally at the mean of x*" -- sure, when the effect is linear, but since the effect changes with $x$, does that really make sense? Nov 30 '15 at 10:52
• Good point, Glen_b. I should specify I am working with negative binomial regression.
– WC4J
Nov 30 '15 at 18:33

I suspect that this is just rounding error: The computer program just used more digits to compute the marginal effect than you did.

Alternatively, if your model is non-linear (e.g. a logit or Poisson) then it could be that the marginal effect you got was actualy an average marginal effect instead of a marginal effect at the average. For an average marginal effect, the marginal effect is computed for each individual and than those marginal effects are averaged. For linear models there is no difference between the two, but for non-linear models these marginal effects are (somewhat) different.

• Thank you for this good explanation. I am working with negative binomial regression where the dependent variables serves as the expected mean in a Poisson distribution. As a result, as I suspected, the marginal effect will vary based on the x value. However, am I correct in understanding the change in ME represents the change in the rate of change of y, while plugging in the value of x in x and x^2 in the actual equation (the -0.106) yields the fitted value as a result of x and x^2?
– WC4J
Nov 30 '15 at 18:37
• Your formula will give you the change in linear predictor, which is not the same as the change in expected count. The latter is probably the thing you are interested in. What ME means is uncertain; as I explained above there are different types of marginal effects. So without additional information I cannot comment on that. Dec 1 '15 at 9:50
• Part of this answer is wrong. The two numbers are not off by a factor of 10 because of rounding error. They differ by a factor of 10 because they represent completely different concepts: one is the predicted value, and one is the marginal effect. What OP calls "y hat" is a predicted value of the outcome variable, while the ME is a change in the outcome variable. Jul 30 '19 at 21:26

-0.106 is calculated from the base regression, and is the predicted value of y given the value of x is equal to 10.

-0.0108 is calculated from the partial derivative of y with respect to x. This is the marginal effect when x=10; so as x increases by 1, we expect y to decrease by 0.0108. -0.0108 is indeed the slope of the function at x=10.