Greetings,
I'm running Stata 15.1 on OSX. I'd like to graph the % of respondents supporting a specific policy by political ideology and survey year. That is, I'd like to be able to illustrate what percent of liberals, moderates and conservatives, respectively, support the policy in question overtime. I can obtain the weighted proportions in a bar graph, but am unable to reproduce them in a two-way line graph. I tried browsing the archives here, but didn't find any help. My example data below consists of 5 variables: immig3 (the policy variable), 3 dummy-coded ideology variables, a year variable (year_ii) and the sample weights. Any help is much appreciated. Thanks in advance!
I'm running Stata 15.1 on OSX. I'd like to graph the % of respondents supporting a specific policy by political ideology and survey year. That is, I'd like to be able to illustrate what percent of liberals, moderates and conservatives, respectively, support the policy in question overtime. I can obtain the weighted proportions in a bar graph, but am unable to reproduce them in a two-way line graph. I tried browsing the archives here, but didn't find any help. My example data below consists of 5 variables: immig3 (the policy variable), 3 dummy-coded ideology variables, a year variable (year_ii) and the sample weights. Any help is much appreciated. Thanks in advance!
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte(immig3 liberal moderate conservative) float year_ii double weight . 0 0 1 . 1 . 0 0 1 . 1 . 0 0 1 . 1 . 0 1 0 . 1 . 0 1 0 . 1 . 0 0 1 . 1 . 0 1 0 . 1 . 0 0 1 . 1 . 0 0 1 . 1 . 0 0 1 . 1 . 0 0 1 . 1 . 1 0 0 . 1 . 0 1 0 . 1 . 0 0 1 . 1 . 0 0 1 . 1 . 0 0 1 . 1 . 0 0 1 . 1 . 0 0 1 . 1 . 0 1 0 . 1 . 0 1 0 . 1 . 1 0 0 . 1 . 0 0 1 . 1 . 0 0 1 . 1 . 0 0 1 . 1 . 0 0 1 . 1 . 0 0 1 . 1 . 0 0 1 . 1 . 0 0 1 . 1 . 0 0 1 . 1 . 0 0 1 . 1 . 0 1 0 . 1 . 0 0 1 . 1 . 1 0 0 . 1 . 0 0 1 . 1 . 1 0 0 . 1 . 0 1 0 . 1 . 0 0 1 . 1 . 0 0 1 . 1 . 0 0 1 . 1 . 0 0 1 . 1 . 0 0 1 . 1 . 0 1 0 . 1 . 0 0 1 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