> I would like to know if -outreg2- can produce multiple formatted
> tables in a single file. I do not mean to produce multiple regression
> results in a single table as the following code shown below:
>
> I would like to have all my robustness test in a single file. Ideally, I
> would like to have two tables from the above two regressions in a
> single file.
It depends on what you want. If you want the whole thing stacked on
top of each other, then the following codes will do it for you. You
will need -dataout- from ssc. I am posting it here because you are the
second person asking for this.
If you want it cleaned up into the so-called panel format, then it can
be done by tweaking it several ways. You could make changes somewhere
after -insheet- but before -outsheet-. You now have the latest
vaporware that will do exactly what you want.
Roy
prog drop _all
prog define panelout
qui {
syntax, use(str asis) save(str asis) *
preserve
tokenize `use'
local num 0
while "``num''"~="" {
local num=`num'+1
tempfile temp`num'
insheet using myfile1.txt, noname clear
save `temp`num''
}
use `temp1',clear
forval n=2/`num' {
append using `temp`n''
}
tempfile out
outsheet using `out', noname
}
dataout using `out', save(`save') `options'
end
sysuse auto, clear
regress price mpg trunk weight length
outreg2 using myfile1, tex bdec(3) tdec(2) sdec(2) replace
regress price mpg trunk
outreg2 using myfile2, tex bdec(3) tdec(2) sdec(2) replace
panelout, save(panelstuff.txt) use(myfile1.txt myfile2.txt) excel replace
erase myfile1.txt
erase myfile2.txt
*
* 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/