Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Generating LaTeX code from more than one model


From   Stas Kolenikov <[email protected]>
To   [email protected]
Subject   Re: st: Generating LaTeX code from more than one model
Date   Thu, 22 Jul 2004 09:23:30 -0400 (EDT)

> I want to produce a table in LaTeX that compares three to four
> regression models, including regression coefficients, standard errors, R
> square, etc.  Is ther a way in Stata to automate this process? I know
> that State has quite a few routines to help LaTeX users, I also
> understand that in the single model case, one can simply use "outtex"
> command. But it is not immediately clear how to generalize this to cases
> that involve more than one models.

If you've already mastered -outreg-, you might find it also relatively
easy to:

1. -outreg- your estimation results;

2. open the resulting file in MS Word;

3. replace the tabs with & and the paragraph lines with \\, and here's
what you need to do:

3a. press Ctrl-H (or go to Edit -> Replace); the string to "Find What" is
"^t" (as is, "Shift-6" on my keyboard, and then "t". You can also find it
under "More -> Special" part of the dialog as tabulation), and the string
to "Replace With" is " & "; then click "Replace All"

3b. press Ctrl-H for the Find and Replace Dialog. The string to be
replaced is "^p" (Shift-6 + p; also can be found in the special symbols as
the paragraph mark), and the string to be replaced with is " \\^p" (so
that it has both the LaTeX end of the table line, and then the regular
carriage return symbol). Click "Replace All" again.

4. your stuff is ready. Of course you would need to provide the
appropriate wraps like \begin{table} \caption{...\label{...}}
\begin{tabular} and \end{tabular} \end{table} around the resulting body.

 ---                                    Stas Kolenikov
 --       Ph.D. student in Statistics at UNC-Chapel Hill
 - http://www.komkon.org/~tacik/  -- [email protected]

* This e-mail and all attachments to it are not intended to provide any
* reasonable point of view and was transmitted to you in error. It
* should be immediately deleted by all recipients unless they really
* enjoy communicating with the author :). Other restrictions apply.

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index