I would like to calculate how the overall prevalence rates of different health conditions have changed over the past few years. I am using survey data which asks respondents to select all applicable answers from a list of 17 different health conditions. Answers are stored in one of seventeen separate variables HEAL01 to HEAL17. Answers are recorded sequentially, so the first answer is held in HEAL01, the second in HEAL02 and so on. A code, one to seventeen, Arms, hands to Other problems, is used within each variable to distinguish each health condition. Each person can give up to 17 health problems and the order doesn’t necessarily give the most problematic first.
I have included an example of HEAL01 and HEAL02 below:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte(HEAL01 HEAL02) 8 . . . 1 2 11 . 2 3 16 . 10 . 16 2 2 . 12 9 1 2 9 16 6 17 end label values HEAL01 HEAL01 label def HEAL01 1 "Arms,hands", modify label def HEAL01 2 "Legs or feet", modify label def HEAL01 3 "Back or neck", modify label def HEAL01 5 "Difficulty in hearing", modify label def HEAL01 8 "Chest,breathing problems", modify label def HEAL01 9 "Heart,blood,pressure,circulation", modify label def HEAL01 10 "Stomach,liver,kidney,digestion", modify label def HEAL01 11 "Diabetes", modify label def HEAL01 12 "Depression,bad nerves", modify label def HEAL01 15 "Mental illness,phobia,panics", modify label def HEAL01 16 "Progressive illness n.e.c.", modify label def HEAL01 17 "Other problems,disabilities", modify label values HEAL02 HEAL02 label def HEAL02 1 "Arms,hands", modify label def HEAL02 2 "Legs or feet", modify label def HEAL02 3 "Back or neck", modify label def HEAL02 9 "Heart,blood,pressure,circulation", modify label def HEAL02 10 "Stomach,liver,kidney,digestion", modify label def HEAL02 16 "Progressive illness n.e.c.", modify label def HEAL02 17 "Other problems,disabilities", modify
How do I create a variable which estimates the total number of people who suffer from each health condition? I want to be able to cross-tabulate that variable with other variables, such as age and ethnicity.
I am using Stata 15.1.
Many thanks in advance.
Nadya
0 Response to Multi-response variables
Post a Comment