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
> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Haseeb Mahmud
> Sent: Friday, September 17, 2004 10:49 AM
> To: [email protected]
> Subject: st: About generating variable consisting elasticities for each
> observations after probit command.
>
> 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/
*
* 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/