Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
re: st: summarizing by more than one grouping variable
From
Christopher Baum <[email protected]>
To
"[email protected]" <[email protected]>
Subject
re: st: summarizing by more than one grouping variable
Date
Tue, 27 Mar 2012 16:18:51 -0400
<>
by: takes a varlist, so you can get summaries by any set of groups you want (including more than two):
bys rep78 foreign: su price, d
However a slightly nicer display can be produced (for any number of by-variables) using egen and tabstat:
egen gp=group(rep78 foreign), label
tabstat price,by(gp)
Kit Baum | Boston College Economics and 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/