Consider the following
I have survey respondent data, from 1973 to 2018. I want to plot, by age group (over50, over/under 50, 1, 0 respectively) how many people support legalizing cannabis (grassnew, 1 who supports, else 0). My first thought is to collapse this, so we get the proportion/mean of people who say yes in each year, and in each age group... But this would be tricky, since I'd need to create more variables/frames to do this.
is there a more elaborate way to do this, simply to plot the group level support trends over time?
Code:
* Example generated by -dataex-. For more info, type help dataex clear input int year float(over50 grassnew) 1973 1 0 1973 1 0 1973 0 1 1973 0 0 1973 1 0 1973 0 0 1973 0 0 1973 0 1 1973 1 0 1973 0 0 1973 1 0 1973 0 0 1973 1 0 1973 0 0 1973 0 0 1973 1 1 1973 0 1 1973 0 0 1973 1 1 1973 1 0 1973 1 0 1973 0 0 1973 0 0 1973 1 0 1973 1 1 1973 0 0 1973 1 0 1973 0 0 1973 1 0 1973 0 1 1973 1 0 1973 1 0 1973 1 0 1973 1 0 1973 0 1 1973 0 0 1973 0 0 1973 0 0 1973 0 0 1973 1 0 1973 0 1 1973 1 0 1973 1 0 1973 0 1 1973 0 0 1973 0 1 1973 1 1 1973 0 0 1973 0 1 1973 0 0 1973 0 0 1973 0 1 1973 1 0 1973 0 0 1973 1 0 1973 0 0 1973 1 0 1973 0 0 1973 1 0 1973 1 0 1973 0 1 1973 0 0 1973 1 0 1973 1 0 1973 1 0 1973 0 0 1973 0 0 1973 0 0 1973 0 0 1973 0 0 1973 0 0 1973 0 0 1973 0 1 1973 0 1 1973 0 1 1973 1 0 1973 0 0 1973 0 0 1973 0 1 1973 1 0 1973 1 1 1973 0 0 1973 1 0 1973 1 0 1973 1 0 1973 1 0 1973 0 1 1973 0 1 1973 0 0 1973 0 0 1973 0 0 1973 0 1 1973 1 0 1973 1 0 1973 0 0 1973 0 0 1973 0 0 1973 1 0 1973 0 0 1973 1 0 end
is there a more elaborate way to do this, simply to plot the group level support trends over time?
Comment