Statalist


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

st: re:


From   Kit Baum <Baum@bc.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: re:
Date   Wed, 11 Nov 2009 09:23:39 -0500

<.
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/



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