Statalist


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

RE: st: latex table with estimation results reported in rows and coefficient estimates listed in columns


From   Roy Wada <[email protected]>
To   <[email protected]>
Subject   RE: st: latex table with estimation results reported in rows and coefficient estimates listed in columns
Date   Wed, 26 Aug 2009 12:12:31 -0700

> The only package that I could find that does that is est2tex, but when
> one produces estimates in this horizontal format it suppresses the
> r-squared and sample size.
> 
> Coefficient 1 Coefficient 2 Sample size R-squared
> Reg 1
> Reg 2

Not many programs will do this. You could use -est2tex- or apply a 
workaround like the one suggested by Roger.
 
Alternatively, you can transpose the text file created by -outreg2- using 
-sxpose- (by Nick C.) and dump it into tex with -dataout-. All available 
from ssc.
 
sysuse auto, clear
reg price mpg weight turn
outreg2 using myfile, replace
outreg2 using myfile
outreg2 using myfile
outreg2 using myfile
insheet using myfile.txt, nonames clear
sxpose, clear
dataout, tex save(mytex)
browse
 
You can add/drop/insert rows/columns at your leisure. You can also customize 
what is reported with -stats( )- option from inside -outreg2-.
 
You can also create what may be referred to as "pivot table" by combining 
-sideway- option in -outreg2- with -sxpose-. This is interesting. You should 
try this if you are outreg/outreg2 user, or previously not quite 
getting what you wanted.
 
sysuse auto, clear
reg price mpg weight turn
outreg2 using myfile, replace side
outreg2 using myfile, side
outreg2 using myfile, side
outreg2 using myfile, side
insheet using myfile.txt, nonames clear
sxpose, clear
dataout, tex save(mytex) replace
browse
 
If you do this and do that and slice it into the original programming, you 
get a highly flexible program with a shamelessly low programming cost - 
both for the user and the person who wrote it.
 
You probably could make this work with -listtex- but I don't know.
 
Roy
 
_________________________________________________________________
Hotmail® is up to 70% faster. Now good news travels really fast. 
http://windowslive.com/online/hotmail?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:WM_HYGN_faster:082009
*
*   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