OTR
Linear regression: showing variable labels instead of variable names
The command outreg2 gives you the type of presentation you see in academic papers. It is important to notice that outreg2
is not a Stata command, it is a user-written procedure, and you need to install it by typing (only the first time)
ssc install outreg2
Follow this example (letters in italics you type)
use "http://dss.princeton.edu/training/Panel101.dta", clear
reg y x1, robust
outreg2 using myreg.doc, replace ctitle(Model 1) label
You can add other model (using variable x2) by using the option append
(NOTE: make sure to close myreg.doc)
reg y x1 x2, robust
outreg2 using myreg.doc, append ctitle(Model 2) label
You also have the option to export to Excel, just use the extension *.xls.
For older versions of outreg2, you may need to specify the option word or excel (after comma)
NOTE: Other options for label: label(insert); label(proper); label(upper); label(lower)
dir : seeout
myreg.doc
. outreg2 using myreg.doc, replace ctitle(Model 1)
Mac users click here to go to the directory where myreg.doc is saved, open it with Word
(you can replace this name with your own)
Windows users click here to open the file myreg.doc in Word (you
can replace this name with your own) . Otherwise follow the Mac
instructions.
dir : seeout
myreg.doc
. outreg2 using myreg.doc, append ctitle(Model 2)
PU/DSS/OTR
Source: Updated version of http://dss.princeton.edu/training/Regression101.pdf