In the following example, I run a regression with quadratic term in the independent variable, followed by the computation of marginal effects at different values of the regressor. Subsequently, I would like to test for equality of the marginal effects at different values of the regressor. What does not make sense to me is that the test command produces identical test statistics for the comparison of the marginal effects at different values. Clearly, these test statistics should be different. Is this a bug or am I doing something fundamentally wrong here?
Code:
. sysuse nlsw88 (NLSW, 1988 extract) . regress wage c.ttl_exp##c.ttl_exp Source | SS df MS Number of obs = 2,246 -------------+---------------------------------- F(2, 2243) = 87.46 Model | 5379.78611 2 2689.89305 Prob > F = 0.0000 Residual | 68988.1813 2,243 30.7571027 R-squared = 0.0723 -------------+---------------------------------- Adj R-squared = 0.0715 Total | 74367.9674 2,245 33.1260434 Root MSE = 5.5459 ------------------------------------------------------------------------------------- wage | Coefficient Std. err. t P>|t| [95% conf. interval] --------------------+---------------------------------------------------------------- ttl_exp | .5570376 .1093103 5.10 0.000 .3426777 .7713976 | c.ttl_exp#c.ttl_exp | -.0094074 .0044334 -2.12 0.034 -.0181014 -.0007135 | _cons | 2.462498 .6392859 3.85 0.000 1.208844 3.716152 ------------------------------------------------------------------------------------- . margins, dydx(ttl_exp) at(ttl_exp=(5(5)25)) post Conditional marginal effects Number of obs = 2,246 Model VCE: OLS Expression: Linear prediction, predict() dy/dx wrt: ttl_exp 1._at: ttl_exp = 5 2._at: ttl_exp = 10 3._at: ttl_exp = 15 4._at: ttl_exp = 20 5._at: ttl_exp = 25 ------------------------------------------------------------------------------ | Delta-method | dy/dx std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- ttl_exp | _at | 1 | .4629635 .0669852 6.91 0.000 .331604 .5943229 2 | .3688893 .0309232 11.93 0.000 .3082482 .4295304 3 | .2748151 .0368297 7.46 0.000 .2025913 .3470389 4 | .1807409 .0754159 2.40 0.017 .0328486 .3286332 5 | .0866667 .1181086 0.73 0.463 -.1449469 .3182803 ------------------------------------------------------------------------------ . test 1._at = 2._at ( 1) [ttl_exp]1bn._at - [ttl_exp]2._at = 0 F( 1, 2243) = 4.50 Prob > F = 0.0340 . test 1._at = 3._at ( 1) [ttl_exp]1bn._at - [ttl_exp]3._at = 0 F( 1, 2243) = 4.50 Prob > F = 0.0340 . test 1._at = 4._at ( 1) [ttl_exp]1bn._at - [ttl_exp]4._at = 0 F( 1, 2243) = 4.50 Prob > F = 0.0340 . test 1._at = 5._at ( 1) [ttl_exp]1bn._at - [ttl_exp]5._at = 0 F( 1, 2243) = 4.50 Prob > F = 0.0340
Comment