Statalist


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

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


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: estout - translating a dollar sign for use in a latex file (Stata 10)
Date   Thu, 12 Nov 2009 22:10:35 +0100

<>

Just double it:


*******
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})
*******

See http://www.stata.com/statalist/archive/2004-11/msg00710.html



HTH
Martin

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Devra Golbe
Sent: Donnerstag, 12. November 2009 21:48
To: statalist
Subject: st: estout - translating a dollar sign for use in a latex file
(Stata 10)

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/



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