Morning all,
For each person in my dataset, I have the treatment they were given as one variable (with 5 categories) and the potential diagnoses in multiple variables (dichotomous: 0, 1) which are not mutually exclusive. I have created a bar chart showing the percentage of those with diagnosis 1 who had each treatment.
graph bar (percent) id if diag1==1, over(treatment)
So far so good. But I want to be able to include the equivalent for each diagnosis in one plot and this is where I am having problems. If the dataset could be reshaped/collapsed so that the diagnoses were in one variable I could just use two over() options in my plot but this doesn't work since my diagnoses are not mutually exclusive. Everything I have found via google and the forum discusses reshaping/collapsing.
Anyone have any ideas how to do this?
Laura
For each person in my dataset, I have the treatment they were given as one variable (with 5 categories) and the potential diagnoses in multiple variables (dichotomous: 0, 1) which are not mutually exclusive. I have created a bar chart showing the percentage of those with diagnosis 1 who had each treatment.
graph bar (percent) id if diag1==1, over(treatment)
So far so good. But I want to be able to include the equivalent for each diagnosis in one plot and this is where I am having problems. If the dataset could be reshaped/collapsed so that the diagnoses were in one variable I could just use two over() options in my plot but this doesn't work since my diagnoses are not mutually exclusive. Everything I have found via google and the forum discusses reshaping/collapsing.
Anyone have any ideas how to do this?
Laura
Comment