Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: outreg: merging results from several regressions


From   John Luke Gallup <jlgallup@pdx.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: outreg: merging results from several regressions
Date   Sat, 2 Feb 2013 14:11:58 -0800

Peter,

The following code should do what you want:

sysuse auto, clear
qui reg price length
outreg, keep(length) se noautosum ctitle("", (1)) rtitle("row1") nod
qui ivreg price (length=weight)
outreg, merge keep(length) se noautosum ctitle("", (2)) rtitle("row1")
qui reg price length rep78
outreg, clear(r2)
outreg, store(r2) keep(length) se noautosum rtitle("row2") nod
qui ivreg price (length=weight) rep78
outreg, merge(r2) keep(length) se noautosum rtitle("row2")
outreg, replay append(r2)

The difficulty is that the -merge- and -append- options always create a new column or a new row, respectively.  There is no way to use them to fill in the (2,2) cell unless you create two tables separately and join them together.  The table above holding the first row is unnamed, and the -outreg, replay- command appends the table named "r2" with the second row.

Alternatively, you could have created a table for each column (using the -append- option) and used -outreg, replay- to merge them together.

John

On Feb 2, 2013, at 2:05 AM, "Peter Neumayr" <peter.neumayr@gmx.at> wrote:

> Hi!
> 
> I'm new to outreg. My task seems quite simple but i can't figure out how to do it. 
> I try to produce a table where each column represent a model (e.g. OLS and IV) and each rows should present results from different regressions.
> 
> That means each table cell should contain a result from a specific regression.
> 
> The best I got so far is:
> --------------------------------
>          (1)         (2)     
> --------------------------------
> row1     57.202      75.419   
>        (14.080)**  (15.056)** 
> row2     65.463               
>        (14.851)**             
> row2     87.716               
>        (16.065)**             
> --------------------------------
> 	 * p<0.05; ** p<0.01
> 
> but what I want is:
> --------------------------------
>          (1)         (2)     
> --------------------------------
> row1     57.202      75.419   
>        (14.080)**  (15.056)** 
> row2     65.463      87.716          
>        (14.851)**  (16.065)**             
> --------------------------------
> 	 * p<0.05; ** p<0.01
> 
> I've used this code:
> 
> clear
> sysuse auto
> outreg, clear(t1)
> qui reg price length
> outreg, merge(t1) keep(length) se noautosum ctitle("", (1)) rtitle("row1") nod
> qui reg price length rep78
> outreg, append(t1) keep(length) se noautosum ctitle("", (1)) rtitle("row2") nod
> qui ivreg price (length=weight)
> outreg, merge(t1) keep(length) se noautosum ctitle("", (2)) rtitle("row1")
> qui ivreg price (length=weight) rep78
> outreg, append(t1) keep(length) se noautosum ctitle("", (2)) rtitle("row2")
> 
> Hoping for help!
> Thanks a lot!
> peter
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index