Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Esttab format question


From   William Buchanan <william@williambuchanan.net>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Esttab format question
Date   Tue, 25 Jun 2013 13:15:42 -0700

There might not be a way to do this in Stata, but you can look at the -siunitx- package in LaTeX to take care of this issue and add the appropriate code to the preamble or at the beginning of each table (it also will make it possible to align the text within the cells to different characters like the decimal).  

HTH,
Billy

Sent from my iPhone

On Jun 25, 2013, at 12:58, "Perez, Victoria" <vep@wharton.upenn.edu> wrote:

> Hello,
> 
> 
> 
> I am trying to output summary tables from Stata to Latex. I need the number of observations in each category and the column percent. The problem is that the counts are large numbers and I need them presented with commas. I have tried a few different formats (%#.#gc, %#.#fc) nest to the respective stat (b) or as the option f(c 1p), but I keep getting an error that these are not valid formats/options. Is there a way to get commas included in the table? 
> 
> estpost tab v1 v2 
> 
> eststo e1
> 
> estpost tab v1 v2 if v3==1
> 
> eststo e2
> 
> estpost tab v1 v2 if v3==0
> 
> eststo e3
> 
> esttab e1 e2 e3 using tabletest.tex, cells("b(fmt(f)) colpct(fmt(1))") collabels("Count" "\%") replace nonum noobs
> 
> 
> 
> 
> 
> 
> 
> 
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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