Statalist


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

Re: st: Transfering a large set of Stata tables into Excel


From   Jeph Herrin <junk@spandrel.net>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Transfering a large set of Stata tables into Excel
Date   Tue, 25 Nov 2008 16:13:45 -0500

Rachel,

I would create the tables differently so that I could -outsheet-
them as CSV files. This may be more work than you want, but:

 local vars "var1-var3 var8-var11 var17-var25"
 unab vars : vars
 foreach l in $Datasets {
   use `l', clear
   di in red "`l'"
   tabstat `vars' , ///
        c(count mean sd min max) st(col) save
   matrix T=r(StatTotal)'
   clear
   svmat T, names(col)
   outsheet using `l'.csv, comma replace
   clear
 }

will create a bunch of CSV files that excel can open directly.




Rachel wrote:
I'm performing the -su- command on a series of variables in each of a
large set of datasets.

The command looks like

global Datasets "dataset1 dataset2....dataset35"
foreach l in $Datasets {
use `l'
di in red "`l'"
su var1-var3 var8-var11 var17-var25
clear
}

 I need to transfer all the resultant tables (maybe 35 of them) into
Excel.  From what I understand, the Copy Table right-click command
only works on a single table at a time , so I have to copy them one by
one, correct?  But because the running display only stores up to a
certain number of lines, I have to do it as the command is running.

Is there another better way to transfer all these tables into Excel
than copying and pasting them one by one?

Thanks very much,
Rachel
*
*   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