Dear all,
I suspect there is a bug in the command margins when used after ivprobit.
Or, perhaps, I've just missed something....
Anyway the problem occurs with Stata 14.1 and not with Stata 14...
Look at the following code:
clear
sysuse auto.dta
ivprobit foreign (weight = length) headroom price
predict xb,xb
margins, dydx(weight) predict(pr) atmeans
sum xb
display "Marginal effect : " _b[weight]*normalden(r(mean)) /* here I compute the marginal effect manually and I get a different marginal effect */
* Check on probit
dprobit foreign weight headroom price
predict xb2,xb
sum xb2
display "Marginal effect : " _b[weight]*normalden(r(mean)) /* note that I get the same marginal effects */
probit foreign weight headroom price
margins, dydx(weight) predict(pr) atmeans /* so it's here */
Any guess on what's wrong?
Many thanks in advance
Lorenzo
I suspect there is a bug in the command margins when used after ivprobit.
Or, perhaps, I've just missed something....
Anyway the problem occurs with Stata 14.1 and not with Stata 14...
Look at the following code:
clear
sysuse auto.dta
ivprobit foreign (weight = length) headroom price
predict xb,xb
margins, dydx(weight) predict(pr) atmeans
sum xb
display "Marginal effect : " _b[weight]*normalden(r(mean)) /* here I compute the marginal effect manually and I get a different marginal effect */
* Check on probit
dprobit foreign weight headroom price
predict xb2,xb
sum xb2
display "Marginal effect : " _b[weight]*normalden(r(mean)) /* note that I get the same marginal effects */
probit foreign weight headroom price
margins, dydx(weight) predict(pr) atmeans /* so it's here */
Any guess on what's wrong?
Many thanks in advance
Lorenzo
Comment