Statalist


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

AW: st: -outreg2- for nonlinear regressions? and -esttab-


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   AW: st: -outreg2- for nonlinear regressions? and -esttab-
Date   Fri, 12 Feb 2010 16:48:19 +0100

<> 

Just -eststo- them and -esttab- them in one fell swoop:


*************
sysuse auto, clear
eststo clear

forv i=2/5{
	eststo:reg price length weight if rep==`i'
}

esttab using myfile, replace
!start myfile.txt
*************



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Cindy Gao
Gesendet: Freitag, 12. Februar 2010 16:41
An: statalist@hsphsun2.harvard.edu
Betreff: Re: st: -outreg2- for nonlinear regressions? and -esttab-

Thank you for the very helpful suggestion. It partly solves
my problem. However, it is not working that well where there is a large number of regressions that I want to export results from. Stata (I use SE) can only handle up to 300 estimates. So I must export these and then say -eststo clear- and then run more regressions. But, when I append the other results to the same file (using esttab using myfile, append) it puts the new results UNDER the original ones. Whereas I need them all side by side in excel. Is there any way to -append- in -esttab- to get results side-by-side? Or an alternative way of achieving same the result?

Thank you again!!

Cindy Gao



----- Original Message ----
From: Maarten buis <maartenbuis@yahoo.co.uk>
To: statalist@hsphsun2.harvard.edu
Sent: Fri, 12 February, 2010 10:29:01
Subject: Re: st: -outreg2- for nonlinear regressions?

--- On Fri, 12/2/10, Cindy Gao wrote:
> PS I also try use estout for the same thing, it works fine
> and exports the results, the problem is that when I append
> (as I run many regressions that I want to compare) it lists
> them one below the other but I need them side by side like
> in outreg2, and I don't know how to store estimates and all
> that to have them side by side in the table using estout.

The simplest way is to use the -eststo:- prefix, like in the
example below

*---------------------- begin example -------------------
sysuse auto, clear
eststo clear
eststo : nl (mpg = {b0} + {b1}*price + {b1}*weight + ///
                   {b1}*displ + {b0}/20*gear_ratio - ///
                   {b0}/20*foreign + {b1}*length)    ///
                   if foreign == 1

eststo : nl (mpg = {b0} + {b1}*price + {b1}*weight + ///
                   {b1}*displ + {b0}/20*gear_ratio - ///
                   {b0}/20*foreign + {b1}*length)    ///
                   if foreign == 0

esttab
*--------------------- end example ----------------------
( For more on how to use examples I sent to statalist see:
http://www.maartenbuis.nl/stata/exampleFAQ.html )

Also see the wide variety of examples on:
http://repec.org/bocode/e/estout/

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------


      

*
*   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/



      


*
*   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/


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