Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: table of study population characteristics


From   Michael McCulloch <mm@pinest.org>
To   Statalist <statalist@hsphsun2.harvard.edu>
Subject   st: table of study population characteristics
Date   Tue, 13 Nov 2007 10:15:37 -0800

Dear Statalist members,
I'd like to make a table which tabulates the following study population characteristics:
group (1 or 2)
sex (% female)
age (median)
treated (% yes)
I've studied -tabstat- and -statsmat-, but don't see a capability of tabulating %.

Additionally, I'd like to know whether the following -tabstat- command can be modified to display the sub-headings of price weight on the line below FOREIGN:

sysuse auto, clear
gen weightclass=0
replace weightclass=1 if weight>3000
lab var weightclass Weight
lab def label_weightclass 0 Light 1 Heavy, modify
lab val weightclass label_weightclass
tab weightclass

* TABSTAT
tabstat price, by(foreign)
sort weightclass
by weightclass: tabstat price weight, stats(count mean median min max) ///
by(foreign) columns(statistics) nototal

Thank you,
--

Michael McCulloch
Pine Street Foundation
124 Pine St., San Anselmo, CA 94960-2674
Tel: (415) 407-1357
Fax: (415) 485-1065
mcculloch@pinestreetfoundation.org
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* 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