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]
st: Limit Columns Using outreg2
From
"Chen, Lenis" <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: Limit Columns Using outreg2
Date
Mon, 25 Jul 2011 14:12:17 -0400
When I use the code below, the outreg2 command appends a new column in the output table (in test.doc) for each regression. Therefore, the output table generated from the code below has five columns labeled ft, five columns labeled tfr, five labeled mmse, etc. What if I only want one column per var one column labeled ft, one column labeled tfr, one column labeled mmse, one column labled trail, and one column labeled cesd? In other words, I want five columns total for my five var variables in the output table (rather than 5*4=20 columns in the table) and four rows representing the four name variables.
foreach var of varlist ft tfr mmse trail cesd {
foreach name of varlist se veg smoke alc {
reg `var' `name'
outreg2 using test.doc, label `append'
local append "append"
}
}
*
* 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/