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

From |
"Nick Cox" <n.j.cox@durham.ac.uk> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
RE: st: Transfering a large set of Stata tables into Excel |

Date |
Tue, 25 Nov 2008 22:27:13 -0000 |

See -help extended_fcn- and -help summarize- then. Nick n.j.cox@durham.ac.uk Rachel One more question: How would I modify the line: file write x _n "`v'" _tab "`: di %9.3g r(mean)'" if I wanted the mean, standard deviation, max and min of each variable on a separate line? I'm sure I can find this in my data manual, but unfortunately, I've loaned it out. On Tue, Nov 25, 2008 at 3:55 PM, Austin Nichols <austinnichols@gmail.com> wrote: > Rachel <academicgirl@gmail.com>: > The -file- command is how I would approach this, but -estout- and > -xml_tab- from SSC are also well-suited to this type of task. > > file open x using tmp.xls, write > global Datasets "dataset1 dataset2 dataset35" > foreach l of global Datasets { > use `l', clear > file write x _n `"`l'"' _n > foreach v of varlist var1-var3 var8-var11 var17-var25 { > su `v', meanonly > file write x _n "`v'" _tab "`: di %9.3g r(mean)'" > } > } > file close _all > !tmp.xls > > On Tue, Nov 25, 2008 at 3:03 PM, Rachel <academicgirl@gmail.com> 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? * * 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/

**Follow-Ups**:**Re: st: Transfering a large set of Stata tables into Excel***From:*"Austin Nichols" <austinnichols@gmail.com>

**References**:**st: Transfering a large set of Stata tables into Excel***From:*Rachel <academicgirl@gmail.com>

**Re: st: Transfering a large set of Stata tables into Excel***From:*"Austin Nichols" <austinnichols@gmail.com>

**Re: st: Transfering a large set of Stata tables into Excel***From:*Rachel <academicgirl@gmail.com>

- Prev by Date:
**Re: st: Transfering a large set of Stata tables into Excel** - Next by Date:
**RE: st: RE: hist with addplot option** - Previous by thread:
**Re: st: Transfering a large set of Stata tables into Excel** - Next by thread:
**Re: st: Transfering a large set of Stata tables into Excel** - Index(es):

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