Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: About generating variable consisting elasticities for each observations after probit command.


From   "jean ries" <[email protected]>
To   [email protected]
Subject   Re: st: RE: About generating variable consisting elasticities for each observations after probit command.
Date   Sat, 18 Sep 2004 00:05:17 +0200 (CEST)

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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index