Solution

The original regression was:

reg price mpg foreign weight trunk headroom

Now add weight squared using factor notation:

reg price mpg foreign c.weight##c.weight trunk headroom

Comparing the results, none of the other variables are significantly affected. But the coefficient on weight becomes negative (but not significant) while the coefficient on weight squared (c.weight#c.weight) is positive and significant.

To figure out what that means you have to think back to your high school algebra, and maybe even your calculus. y=-ax+bx^2 is a parabola, opening upwards, which means y starts high, then decreases, and then goes back up again. The slope, dy/dx, is -a+2bx so it starts negative and then becomes positive if x is big enough. In this case you could very easily plug in the values of a (the coefficient on weight) and b (the coefficient on weight squared) and find the slope (the effect increasing weight has on price) at any x (weight) you wish. But you can also have Stata do it for you using the margins command:

margins, dydx(weight) at(weight=x)

where x should be replaced by a number. If you asked it for the effect at a very small weight, say, ten pounds, the slope would indeed be negative:

margins, dydx(weight) at(weight=10)

Now it might make sense that if you had a ten pound car, making it heavier would make it less valuable. But let's not pretend a regression run on 1978 cars tells us anything about such a situation. When we ask "Does increasing weight ever reduce the price in this data set?" we're implicitly saying weight should be in the same range as the weights of the cars in the data set. We can see what that range is with:

sum weight

The minimum weight is 1760, and we can see the effect of weight at that point with:

margins, dydx(weight) at(weight=1760)

and it is positive. If we didn't trust our calculus we could check it at the maximum value as well:

margins, dydx(weight) at(weight=4840)

where it is even more positive. So no, increasing weight never reduces price in this data set. It's a near thing though: if you do the algebra the slope is zero at about 1695.4, as you can see with:

margins, dydx(weight) at(weight=1695.4)

Last Revised: 12/18/2009