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

Re: st: saving dprobit results to excel


From   Buzz Burhans <wsb2@cornell.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: saving dprobit results to excel
Date   Thu, 17 Jun 2004 14:39:27 -0400

At 11:03 PM 6/17/2004 +0600, you wrote:
I need to save the impact/marginal effects that are reported by dprobit to an excel file. I tried using the statsby command which worked very well, until I realised that it was saving/exporting (to excel) the coefficients (that are calculated by the inherent probit regression) rather than the impact effects. Is there a way of doing this?

Reetika,

Undoubtedly the Stata gurus on the list can do this with much more facility, but I happened to have a similar problem trying to get results from mfx into a table last week. I was using Roger Newson's -parmest-, which is a GREAT utility, but it doesnt handle the matrix output by mfx, so I put this together to capture and later merge what I wanted in. perhaps you could adapt it to your needs. After running the regression, I run mfx compute, and then the code I used follows below. The data file you end up with can then be placed into excel by whatever means you typically do.

Buzz Burhans



mfx compute
tempfile tfilemfx
mat mfxmat=e(Xmfx_dydx) // look at ereturn after mfx list to see where this comes from
mat mfxmat2 = mfxmat' //note the transpose
mat list mfxmat2
svmatf, mat(mfxmat2) fil("`tfilemfx'.dta") verb // author is J. Brogger, available on SSC
use "`tfilemfx'.dta", clear
rename r1 Marginal
rename row parm
save "`tfilemfx'.dta", replace

matrix drop mfxmat
matrix drop mfxmat2






Buzz Burhans
wsb2@cornell.edu


*
* 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index