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]
st: tabout: display summary counts of only unique subjects
From
Michael McCulloch <[email protected]>
To
[email protected]
Subject
st: tabout: display summary counts of only unique subjects
Date
Sun, 26 Jan 2014 15:12:23 -0800
I have created a dataset of test results, in which each subject (id) has three other covariates (age, gender, and test type), that never vary.
I'd like to create a table in which the columns are subject type (diseased vs. non-diseased), and
rows are subdivided into the three subsections (age, gender, and test type),
so that within each cell of each subsection, the number of subjects is summed.
Since there are multiple observations per subject id, then the following code is not suitable, as each subject is counted multiple times.
Might anybody have advice on how to narrow the table to just the unique id's
tabout utitype agecat gender type uti using "Subject Characteristics.xls" if type!=1, ///
cells(freq col) format(0 1) clab(No. Col_% Cum_%) replace ///
bt style(csv) cl1(2-10) cl2(2-4 5-7 8-10) font(bold) show(all)
Best wishes,
Michael McCulloch
--
Pine Street Foundation, since 1989
124 Pine Street | San Anselmo | California | 94960-2674
P: (415) 407-1357 | F: (206) 338-2391 | http://www.PineStreetFoundation.org
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/