![Statalist](/includes/images/head_statalist.jpg) |
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: tabulation of means, by group
Hello,
In the following simulated data, I'd like to create a table of mean
age (row header) for:
each of 3 income levels (with income level the column sub-header)
within each of 2 groups (with group the column main header)
So that:
from left to right in the data area would groups 1, 2, and 3,
within each group, from left to right would be income categories
And in each cell the mean age.
Here are the data I've created:
clear
set obs 100
set seed 12358
gen age =30 + int(20*uniform())
format age %2.0f
gen income =1 + int(3*uniform())
gen group =1 + int(2*uniform())
Any help would be appreciated.
--
Best wishes,
Michael McCulloch
Pine Street Foundation
124 Pine St., San Anselmo, CA 94960-2674
Tel: (415) 407-1357
Fax: (415) 485-1065
[email protected]
www.pinestreetfoundation.org
*
* 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/