Hello all. Sorry for the novice query but I have struggled with this for the best part of today. I am trying to visualise whether or not a score (on a scale 0-10) has changed over time amongst patients recruited to a study. I do not have multiple data points for each patient and so I am trying to see whether the population of patients recruited has changed over time.
In my data (below), "amts" is the score and "timesincelaunch" is the time period. As the median is "9" throughout the dataset, I can't really plot medians on a line graph and would like to create a stacked bar chart instead, i.e. showing the proportion of patients with each score (10, 9, 8) at each time point. I have tried
and using "collapse" but neither approach led to anything meaningful.
Can anyone suggest a way forward?
In my data (below), "amts" is the score and "timesincelaunch" is the time period. As the median is "9" throughout the dataset, I can't really plot medians on a line graph and would like to create a stacked bar chart instead, i.e. showing the proportion of patients with each score (10, 9, 8) at each time point. I have tried
Code:
graph bar amts, over(timesincelaunch) stack"
Can anyone suggest a way forward?
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte amts float timesincelaunch 10 0 1 1 10 6 10 7 9 9 10 9 6 9 4 10 8 10 10 10 end
Comment