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 on April 23, and its replacement, is already up and running.

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

st: Limit Columns Using outreg2

From   "Chen, Lenis" <>
To   "" <>
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:

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