Here is a (necessarily personalised) view point on Stata's "outreg2" command, especially on its tex capabilities
- As its (rather copious) help indicates, when multiple regression outputs sought to be appended to ONE tex file, the tex command must be provided ONLY on the last instance of "outreg2".
Consider, for instance, 3 (trivial) regressions:
reg y x1 x2
outreg2 using example, replace
reg y x1 x2 x3
outreg2 using example, append
reg y x1 x2 x3 x4
outreg2 using example, append tex
This is the correct order of usage, if (as in many cases) one considers minor modifications to a single framework and desires the ouput in one tex file
- Variable labels: to preserve labels assigned to variables, note that appending "see labels" to the final instance of "outreg2" is mandatory, else the labels are not printed!
[This is independent of whether the output format is tex, word or excel]
To continue with the trivial example above:
I.
reg y x1 x2
outreg2 using example, replace see labels
reg y x1 x2 x3
outreg2 using example, append see labels
reg y x1 x2 x3 x4
outreg2 using example, append see labels
Note that ommitting the "see labels" in the first and second instance of "outreg2" will have no influence on labels being inserted in the file "example", while retaining "see labels" in the first two instances, dropping it on the third will ensure that labels are not printed!
- When using the "tex" option, it is probably better to use "tex(frag)" since if the desire is to finally collate output into one tex file, this option simply allows one to either "\include{}" or "\input" the relevant file into the Master tex file.
eg. [In the Master tex file]
\input table1
\input table2
and so on
[which will not work with the "tex" option unless one manually deletes the "\begin{document} and the \end{document}", along with any "\usepackages{}"]
- An issue with this approach is with tables too large (horizontally) to fit into one page (i.e. a few columns are truncated or cut-off), as is common with many economic regressions; an idea would be to rotate the tables to be oriented vertically; this maybe carried out in the Master tex file using "\usepackage{rotating}" and inserting a "\begin{sidewaystable}" before each of the tables manually--in the original files, NOT in the master file! [see the Latex-related "rotating tables" on this blog]
- directing the output to a file: especially tricky if the file is in a different folder; see under "Windows file names and Stata" on the blog
Subscribe to:
Post Comments (Atom)
1 comment:
thanks!
Post a Comment