Dear Stata users,
I am analyzing a dataset of the following type that includes patient’s co-morbidities such as asthma, hypertension, diabetes etc.
Regnumber asthma hypertension diabetes
1001 0 1 0
1001 0 0 0
1002 0 1 0
1002 0 0 0
1002 0 0 0
1004 0 0 0
1005 0 1 0
1005 0 0 0
1009 0 0 1
1009 0 0 0
Please note that this is not a longitudinal data set rather a multiple response data set where a person may report more than one diseases. I need to generate a new data set that only includes a single id row for each subject but explicitly showing if a person has a particular morbidity or not (for example, has hypertension or not). So, the data set I am looking for would look like the following:
Regnumber asthma hypertension diabetes
1001 0 1 0
1002 0 1 0
1004 0 0 0
1005 0 1 0
1009 0 0 1
Please give some advice on how I could generate the above data set.
Thanks in advance !!!
I am analyzing a dataset of the following type that includes patient’s co-morbidities such as asthma, hypertension, diabetes etc.
Regnumber asthma hypertension diabetes
1001 0 1 0
1001 0 0 0
1002 0 1 0
1002 0 0 0
1002 0 0 0
1004 0 0 0
1005 0 1 0
1005 0 0 0
1009 0 0 1
1009 0 0 0
Please note that this is not a longitudinal data set rather a multiple response data set where a person may report more than one diseases. I need to generate a new data set that only includes a single id row for each subject but explicitly showing if a person has a particular morbidity or not (for example, has hypertension or not). So, the data set I am looking for would look like the following:
Regnumber asthma hypertension diabetes
1001 0 1 0
1002 0 1 0
1004 0 0 0
1005 0 1 0
1009 0 0 1
Please give some advice on how I could generate the above data set.
Thanks in advance !!!
Comment