Try this:
. sysuse auto, clear
. probit foreign mpg
. predict xbeta, xb
. gen elasticity = _b[mpg]*normden(xbeta)
Best regards,
Jean
> One way, assuming no missing observations, would be as follows:
>
> sysuse auto, clear
> probit foreign mpg
> gen elasticity = .
> qui {
> forv i = 1/74 {
> local num = mpg[`i']
> mfx , at(`num') nose
> matrix A = e(Xmfx_dydx)
> replace elasticity = A[1,1] in `i'
> }
> }
>
> Hope this helps,
> Scott
>
>
>> Dear Fellows
>> I can run 'probit' models in STATA environment. I can also run 'mfx'
>> command with its options.
>> I want to generate a variables containing elasticities for each
>> observations (approx 5000 obs.)
>> By default, STATA can show/calculate a elasticities by using 'mfx'
>> command at mean of observations.
>> STATA can also calculate elasticities of each variable at user defined
>> points.
>> Is there anyone who can help me to get out of this problem?
>>
>> Haseeb Mahmud
>> Dhaka, Bangladesh.
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/