Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Eric Booth <eric.a.booth@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: How to send -table- output to LaTeX table |
Date | Sun, 6 May 2012 21:46:57 -0500 |
<> Take a look at the latex options for -tabout- from SSC. Another option is building this table in memory with -collapse- or some equivalent and then exporting the dataset with -texdoc- from SSC. - Eric __ Eric A. Booth Public Policy Research Institute Texas A&M University ebooth@ppri.tamu.edu +979.845.6754 On May 6, 2012, at 8:27 PM, Richard Herron wrote: > Is there a way to send -table- output to a LaTeX table? Or generate > similar output with I can typically find a solution using -estpost- > (from the -estout- package on SSC) combined with -tabstat- or > -tabulate-, but here I would like either a oneway table with > subdivisions of the sorting variable and several summary statistics > variables: > > . sysuse auto, clear > (1978 Automobile Data) > > . table foreign, by(rep78) c(mean headroom mean trunk) > > ------------------------------------------ > Repair | > Record | > 1978 and | > Car type | mean(headroom) mean(trunk) > ----------+------------------------------- > 1 | > Domestic | 1.8 8.5 > Foreign | > ----------+------------------------------- > 2 | > Domestic | 3.4 14.625 > Foreign | > ----------+------------------------------- > 3 | > Domestic | 3.2 15.5926 > Foreign | 2.7 12.3333 > ----------+------------------------------- > 4 | > Domestic | 3.4 16.6667 > Foreign | 2.5 10.3333 > ----------+------------------------------- > 5 | > Domestic | 2.3 9.5 > Foreign | 2.6 11.8889 > ------------------------------------------ > > Or a twoway table with several summary statistics (I guess for this > case I could do two -tabulate, summarize()- tables): > > . table foreign rep78, c(mean headroom mean trunk) > > ------------------------------------------------------- > | Repair Record 1978 > Car type | 1 2 3 4 5 > ----------+-------------------------------------------- > Domestic | 1.8 3.4 3.2 3.4 2.3 > | 8.5 14.625 15.5926 16.6667 9.5 > | > Foreign | 2.7 2.5 2.6 > | 12.3333 10.3333 11.8889 > ------------------------------------------------------- > > I can't figure out how to generate these in -tabulate- or -tabstat-. > Should I manually generate these tables in LaTeX? > > Thanks! > > Richard Herron > * > * 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/