<.
Martin schreib
" Though it surprises me as to why tabstat is not 'byable' at two levels"
In defence of -tabstat-:
*************
by rep78 foreign, sort: tabstat price mpg headroom, statistics( mean count )
columns(statistics)
*************
or even
clear all
sysuse auto
drop if rep78>3
egen repf = group(rep78 foreign) , label
tabstat price mpg headroom, statistics( mean p50 ) col(stat) by(repf) not save
forv i=1/4 {
mat res=nullmat(res)\r(Stat`i')
}
mat res2 = res'
mat li res2, f(%9.2f)
// outtable from ssc
outtable using res2, mat(res2) f(%9.2f) replace
Kit Baum | Boston College Economics & DIW Berlin | http://ideas.repec.org/e/pba1.html
An Introduction to Stata Programming | http://www.stata-press.com/books/isp.html
An Introduction to Modern Econometrics Using Stata | http://www.stata-press.com/books/imeus.html
*
* 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/