Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Capturing e(_estimates_name) into an estout statement


From   Rob James <[email protected]>
To   [email protected]
Subject   st: Capturing e(_estimates_name) into an estout statement
Date   Wed, 30 Dec 2009 17:44:55 -0800

After running a logistic regression model and using eststo to save the 
results, I see that a macro variable
(estimates_name) is generated.

Using estout I'd like to capture that estimates_name to the csv file 
along with the beta estimates and CIs. Here's an editted screen grab:

xi: logistic .....
eststo test

ereturn list
...

macros:
    e(_estimates_name) : "test"
            e(cmdline) : "logistic newdelayed  _Isex_* _Iagegrp2_* 
_Iracegrp_* _Ifirsttime_*  _Ilocation__*  _Ihour_.."
                e(cmd) : "logistic"
            e(predict) : "logistic_p"
...


With the following command I can capture and output the OR and CI:

estout  using example6.csv, replace  cells("b(fmt(3)) ci_l(fmt(3)) 
ci_u(fmt(3))" ) eform type

which yields:

_Isex_0 0.324   0.281   0.373
_Iagegrp2_1     4.013   3.527   4.566
_Iagegrp2_2     2.843   2.423   3.335
_Iagegrp2_3     1.817   1.379   2.394

But I am looking for a syntax for estout which would yield:

test _Isex_0 0.324   0.281   0.373
test _Iagegrp2_1     4.013   3.527   4.566
test _Iagegrp2_2     2.843   2.423   3.335
test _Iagegrp2_3     1.817   1.379   2.394

where "test" was the contents of e(_estimates_name).

Any suggestions?

Thanks,

Rob





*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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