Dear All,
A laud to numhess:
<hansl>
include a_eff.gfn # not uploaded version, since it requires 2017d
open transport.gdt
logit auto 0 dtime
bl = $model
exey(&bl) #including "logit" into exey() took 1 minute of coding!!!
<hansl>
output:
logit elasticities on Pr(auto = 1):
coefficient std. error z p-value
------------------------------------------------------
dtime -0.0373775 0.0205797 -1.816 0.0693 *
<stata>
use
http://www.principlesofeconometrics.com/poe4/data/stata/transport.dta, clear
logit auto dtime
margins, eyex(dtime) atmeans
------------------------------------------------------------------------------
| Delta-method
| ey/ex Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
dtime | -.0373775 .0205797 -1.82 0.069 -.077713 .002958
------------------------------------------------------------------------------
The same is with probit.
The timing is even better than for
mfx() which uses analytical formulas
but for b[k]*x + b[k+1]*x^2
Oleh