Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Exporting tables to Excel
From
Eric Booth <[email protected]>
To
"<[email protected]>" <[email protected]>
Subject
Re: st: Exporting tables to Excel
Date
Fri, 4 Mar 2011 14:28:49 +0000
<>
-tabout- (from SSC) will allow you to put many variables in the c() option and varlist.
Did you specify the 'sum' option as well? Also, keep in mind that the 'n' stat you specified should be 'N'.
Let us know the -tabout- code you tried that isn't working.
This example exports an excel table (really just a text file that excel will open since I gave it a xls extension) with some summary stats (N, mean, median) for 3 variables by 5 other variables.
***************!
sysuse auto, clear
tabout for rep78 trunk using "myexcelfile.xls", sum replace ///
c(mean mpg N mpg mean price N price median turn median headr N weight) ///
f(1c) ptotal(both)
***************!
Take a look at this for some help with -tabout-: http://fmwww.bc.edu/repec/bocode/t/tabout_tutorial.pdf
There are lots of other options out there besides -tabout- (though it's the one I most commonly use). Try typing -findit export table- into the command line to see some other user packages that have similar functionality.
- Eric
__
Eric A. Booth
Public Policy Research Institute
Texas A&M University
[email protected]
Office: +979.845.6754
On Mar 4, 2011, at 7:58 AM, Diana Iancu wrote:
> Dear all,
>
> Is it possible to export complicated tables from Stata to Excel, for instance:
> table var1 var2, c(n var3 mean var3) ?
> I have tried tabout, but as far as I can see, it doesn't allow me to include more than one variable in c( ) or to table 3 variables.
> Your assistance will be highly appreciated.
>
> Best regards,
> Diana Iancu
>
>
>
>
> *
> * 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/