Hi everyone!
I have four variables in stata typenonap1_recode typenonap2_recode typenonap3_recode typenonap4_recode. For each observation, each variable has a value of 1-14. If I tab each variable separately I see the frequency for each value. I want to generate a variable that will show the combined frequency of all 14 values in all the 4 variables.
In other words, each variable says "What type of medication" and the answer is 1 antidepressant, 2 mood stabilizer... all the way up to 14 types. When I tab each variable separately I get the frequency of each value, so 1- antidepressant - freq 96, 2 mood stabilizer freq74. I can hand-sum the 4 variables, but can I just create a 5th variable that sums them?
thanks!
Will
I have four variables in stata typenonap1_recode typenonap2_recode typenonap3_recode typenonap4_recode. For each observation, each variable has a value of 1-14. If I tab each variable separately I see the frequency for each value. I want to generate a variable that will show the combined frequency of all 14 values in all the 4 variables.
In other words, each variable says "What type of medication" and the answer is 1 antidepressant, 2 mood stabilizer... all the way up to 14 types. When I tab each variable separately I get the frequency of each value, so 1- antidepressant - freq 96, 2 mood stabilizer freq74. I can hand-sum the 4 variables, but can I just create a 5th variable that sums them?
thanks!
Will
Comment