Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: RE: RE: Create a table of estimation results from several simple regressions
From
Ángel Rodríguez Laso <[email protected]>
To
[email protected]
Subject
Re: st: RE: RE: Create a table of estimation results from several simple regressions
Date
Wed, 30 May 2012 12:09:10 +0200
Dear Lance,
I'm also interested in Hasan's question and I've tried your promising
code with the following result (working with Stata 9.2 for Windows):
. reg price mpg
Source | SS df MS Number of obs = 74
-------------+------------------------------ F( 1, 72) = 20,26
Model | 139449474 1 139449474 Prob > F = 0,0000
Residual | 495615923 72 6883554,48 R-squared = 0,2196
-------------+------------------------------ Adj R-squared = 0,2087
Total | 635065396 73 8699525,97 Root MSE = 2623,7
------------------------------------------------------------------------------
price | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
mpg | -238,8943 53,07669 -4,50 0,000 -344,7008 -133,0879
_cons | 11253,06 1170,813 9,61 0,000 8919,088 13587,03
------------------------------------------------------------------------------
. matrix mpg = r(table)'
. matrix mpg = mpg[1,1..2],e(N)
conformability error
r(503);
Best regards,
Angel Rodriguez-Laso
2012/5/30 Lance Erickson <[email protected]>:
> Hassan,
>
> When I have problems like this I take advantage of the results Stata saves
> after a model and put the information I need into a matrix. The help file
> for -esttab- suggests it can tabulate matrices. So you might do something
> like this...
>
>
> sysuse auto, clear
>
> reg price mpg
> matrix mpg = r(table)'
> matrix mpg = mpg[1,1..2],e(N)
>
> reg price rep78
> matrix rep78 = r(table)'
> matrix rep78 = rep78[1,1..2],e(N)
>
> reg price turn
> matrix turn = r(table)'
> matrix turn = turn[1,1..2],e(N)
>
> matrix table = mpg\rep78\turn
>
> matrix colnames table = b se N
>
> esttab matrix(table)
>
>
> Of course, you can modify the output table as described in the -esttab-
> help file (Ben Jann from SSC) but this should give you the basic structure
> you're looking for. (Although not necessary, looping through the independent
> variables would be more efficient and wouldn't be too difficult if you're
> familiar with using -foreach-.)
>
> Best,
> Lance
> ________________________________________
> From: [email protected]
> [[email protected]] on behalf of David Radwin
> [[email protected]]
> Sent: Tuesday, May 29, 2012 11:49 AM
> To: [email protected]
> Subject: st: RE: Create a table of estimation results from several simple
> regressions
>
> Hassan,
>
> You might find it easiest to create your own (pipe- or comma- or
> tab-delimited) text file using the -file- command. This will require a
> little programming but will give you much more flexibility. See, for
> example:
>
> http://www.stata.com/statalist/archive/2008-02/msg00362.html
>
> David
> --
> David Radwin
> Senior Research Associate
> MPR Associates, Inc.
> 2150 Shattuck Ave., Suite 800
> Berkeley, CA 94704
> Phone: 510-849-4942
> Fax: 510-849-0794
>
> www.mprinc.com
>
>> -----Original Message-----
>> From: [email protected] [mailto:owner-
>> [email protected]] On Behalf Of Hassan Enayati
>> Sent: Tuesday, May 29, 2012 10:17 AM
>> To: [email protected]
>> Subject: st: Create a table of estimation results from several simple
>> regressions
>>
>> Hello all,
>>
>> I need to create a table of estimation results, including estimates,
>> standard errors, and number of observations, from several simple
>> regressions. The finished table should have the following structure:
>>
>> Model 1 | Estimate | Std. Error | Num. Obs.
>> Model 2 | Estimate | Std. Error | Num. Obs.
>> Model 3 | Estimate | Std. Error | Num. Obs.
>>
>> At first, I used eststo and then esttab. Unfortunately, I can not get
>> the esttab output to take the above specified form. The problem with
>> esttab is that even under the wide option, it tabs over for each
>> model. Additionally, esttab won't place the number of observations as
>> the last entry on a given row. The result looks like the following:
>>
>> M1 | Est | SE |
>> Number of Obs
>> M2 | Est | SE | #
>> Number of Obs
>> M3 | Est | SE | #
>> Number of Obs
>>
>> How can I produce a table that looks like the first structure I showed
>> above? Thanks in advance for the help.
>>
>> --
>> Hassan
>
> *
> * 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/