Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: summarizing by more than one grouping variable


From   Lars Folkestad <lfolkestad@health.sdu.dk>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: summarizing by more than one grouping variable
Date   Tue, 27 Mar 2012 21:19:20 +0200

I cannot see my way out of this. There is probably a simple solution.

I want to summarize my data using two fx sex and type.

Normally i would use:
by type, sort: summarize var1, d

To summarize the variable var1 for each type (or group if you like).

I would like to see the mean for type1 and female sex, and type1 and male sex and type2 and female sex and type2 male sex.

lars

*
*   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   |   Site index