Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: CREATING MUTUALLY EXCLUSIVE MULTILEVEL CATEGORICAL VARIABLE


From   "Leonard Egede" <[email protected]>
To   <[email protected]>
Subject   st: CREATING MUTUALLY EXCLUSIVE MULTILEVEL CATEGORICAL VARIABLE
Date   Sat, 17 Jul 2004 07:18:14 -0400

I would appreciate your assistance with this question.

I am trying to create a categorical variable with 8 levels each representing the presence of one of six discrete disease conditions. However, it is possible for subjects to have more than 1 disease condition. How do I create such a multi-level variable so that each level contains only subjects with 1 of the disease conditions and those with multiple disease conditions fall into a level and those with none of the diseases of interest fall into another level?

I tried the generate and replace commands as shown below but i am uncertain of how stata handles arguments in the replace command

***What i have done so far***
I created a multi-level variable using generate and replace capture discrete medical conditions with 7 categories as follows
generate disease
replace disease=2 if medical condition ==A
replace disease=3 if medical condition ==B
replace disease=4 if medical condition ==C
replace disease=5 if medical condition ==D
replace disease=6 if medical condition ==E
replace disease=7 if medical condition ==F

The questions are - is this the right method? if so  how do i code subjects with more than 1 of the conditions above i.e any combinations of A thru F. Also, how does this approach handle
people with 2 or more of the specified conditions.

I intend to use the 8 level variable in a logistic model with level 1 (those without diseases of interest) as the reference.
Thanks
 


Leonard E. Egede MD, MS.
Assistant Professor of Medicine
Medical University of South Carolina/Center for Health Care Research
135 Cannon Street, Suite 403
PO BOX 250837
Charleston, SC 29425

Director, Charleston TREP
Understanding Health Disparities in Chronic Diseases
Ralph H. Johnson VA Medical Center
Rm F229
109 Bee Street
Charleston, SC 29401


Email: [email protected]
Tel: 843-792-2969
Tel: 843-789-6670  (Alternate)
Fax: 843-876-1201


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index