Statalist


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

Re: st: estout - translating a dollar sign for use in a latex file (Stata 10)


From   Devra Golbe <[email protected]>
To   [email protected]
Subject   Re: st: estout - translating a dollar sign for use in a latex file (Stata 10)
Date   Thu, 12 Nov 2009 20:06:11 -0500

Thanks to Martin & Sergey for solving the problem. Once I had the answer, I found Nick Cox's article http://www.stata-journal.com/article.html?article=pr0042 and Alan Riley's FAQ http://www.stata.com/support/faqs/lang/backslash.html helpful in figuring out why the double backslash works.

Devra

On 11/12/2009 6:31 PM Sergiy Radyakin wrote:
Does this fix it?
....
substitute(_ \_  $  \\$  %  \% ) ///
....
Regards, Sergiy Radyakin


On Thu, Nov 12, 2009 at 3:47 PM, Devra Golbe <[email protected]> wrote:
The following code using Ben Jann's wonderful -estout- (SJ) produces a
summary statistics table in latex format.  The -substitute- option lets me
substitute "\%" for the "%" which appears in a variable label.  I have not
been able to figure out what combination of compound quotes, etc. is
necessary to turn a "$" into a "\$".  I suspect that Stata reads the dollar
sign in the -substitute- option as indicating an empty macro, but neither
that suspicion nor a search of the help files or web has turned up a
solution.

Thanks,
Devra

********************************
sysuse auto
label var price "Price ($), not (%)"
estpost summ price weight mpg
estimates store sum
estout sum, ///
title (Summary Statistics) ///
mlabels(, none) ///
cells ("mean (fmt(%9.2fc))  sd (fmt(%9.2fc )) count (fmt(%9.0f))")label  ///
style(tex) ///
substitute(_ \_  $  \$  %  \% ) ///
prehead(\begin{tabular}{ll*{3}{r}}) ///
posthead("\hline") prefoot("\hline") ///
postfoot(\hline\end{tabular})

******************
Devra Golbe
Professor of Economics
Hunter College /CUNY
695 Park Ave, NY, NY


*
*   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/


*
*   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/


*
*   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/



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