<>
-xtsum- does not return a matrix of results, but r() returns for the last
variable it evaluated. So you have to be creative here...
**************
webuse nlswork, clear
capture erase info.dta
tempname hdle
postfile `hdle' str32(var category)/*
*/ mean sd min max obs using info
foreach var of varlist /*
*/ hours race nev_mar grade{
qui xtsum `var'
post `hdle' ("`var'") ("overall") /*
*/ (`r(mean)') (r(sd)) (r(min)) /*
*/ (r(max)) (r(N))
post `hdle' ("`var'") ("between") /*
*/ (.) (r(sd_b)) (r(min_b)) /*
*/ (r(max_b)) (r(n))
post `hdle' ("`var'") ("within") /*
*/ (.) (r(sd_w)) (r(min_w)) /*
*/ (r(max_w)) (r(Tbar))
}
postclose `hdle'
use info, clear
l, abbrev(12) noobs sepby(var)
//to spreadsheet!
xmlsave "myxmlfile", doctype(excel) replace
!start myxmlfile.xml
**************
HTH
Martin
-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Dorothy Bridges
Sent: Montag, 28. September 2009 21:02
To: statalist@hsphsun2.harvard.edu
Subject: st: Exporting xtsum output?
Dear Statalist:
Is there an equivalent of outreg for xtsum? "Copy table" isn't quite
working to get my panel summary statistics into Excel.
Thanks,
Dorothy
*
* 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/