Hi All,

I would like to post-estimate marginal effects by group after executing reg3 or xtivreg. For instance,

[PHP][/reg3 (x y z a1 a2 a3 i.qtr)(y x z a4 a5 a6 a7 i.ID i.qtr)(z x y a1 a2 a3 i.ID i.qtr),endog(x y z) small]

OR

[PHP][/xtivreg y a4 a5 a6 a7 i.ID i.qtr (x z = a1 a2 a3)]


However, when I run

For reg3, [PHP][/margins, dydx(x) at(z=(1(1)5)) predict(equation(#2)) noestimcheck] OR [PHP][/margins ID, dydx(x) predict(equation(#2)) noestimcheck]

For xtivreg, [PHP][/margins, dydx(x) at(z=(1(1)5)) noestimcheck] OR [PHP][/margins ID, dydx(x) noestimcheck]


The results show no difference in dydx across groups. I do expect variations between groups, may I ask for your help to check if I get wrong in the codes? Many thanks.


Average marginal effects Number of obs = 2580
Model VCE : Conventional

Expression : Linear prediction, predict()
dy/dx w.r.t. : x

1._at : z = 1

2._at : z = 2

3._at : z = 3

4._at : z = 4

5._at : z = 5

------------------------------------------------------------------------------
| Delta-method
| dy/dx Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x |
_at |
1 | .7323913 .1124872 6.51 0.000 .5119203 .9528622
2 | .7323913 .1124872 6.51 0.000 .5119203 .9528622
3 | .7323913 .1124872 6.51 0.000 .5119203 .9528622
4 | .7323913 .1124872 6.51 0.000 .5119203 .9528622
5 | .7323913 .1124872 6.51 0.000 .5119203 .9528622
------------------------------------------------------------------------------