Dear all,
I want to compare the data for distribution of education levels in my sample with the distribution of the basic population in a single bar chart. The two variables of interest are
1 "bild_grp" (education level) with 1=low 2=medium 3=high and
2 "wo" (location) with 1=western Germany 2=eastern Germany.
The distribution of my sample data is:
The known distribution for the population is:
The population data however is not part of my data set but just information from public statistics. I didnt find a way to create a variable and giving it that distribution over all observations, so I created six variables - one with each value for all observations.
Now I am trying to find any way of visualizing the two distributions in one bar chart, either with the population data being shown as horizontal lines above the bars of my sample data, or being bars as well but 'behind'/overlapping the sample data bars. (The closest I found in this forum was #3 post on Belindas thread.)
The following line gives me the chart for my sample data:
graph bar if status==1, over(bild_grp) over(wo) asyvars title (Bildungsabschlüsse nach Ost/West) legend(on) percent
I learned that adding the option yline(25) would draw a horizontal line at y=25, and wondered whether I could limit the area on the a axis for every y-value, but couldnt find a way doing so.
Hoping that you can help me out, thanks!
Adam
I want to compare the data for distribution of education levels in my sample with the distribution of the basic population in a single bar chart. The two variables of interest are
1 "bild_grp" (education level) with 1=low 2=medium 3=high and
2 "wo" (location) with 1=western Germany 2=eastern Germany.
The distribution of my sample data is:
West | Ost | |
low | 30.43% | 19.80% |
medium | 36.91% | 52.11% |
high | 32.66% | 28.09% |
West | Ost | |
low | 43.46% | 22.83% |
medium | 25.52% | 48.73% |
high | 31.02% | 28.44% |
Now I am trying to find any way of visualizing the two distributions in one bar chart, either with the population data being shown as horizontal lines above the bars of my sample data, or being bars as well but 'behind'/overlapping the sample data bars. (The closest I found in this forum was #3 post on Belindas thread.)
The following line gives me the chart for my sample data:
graph bar if status==1, over(bild_grp) over(wo) asyvars title (Bildungsabschlüsse nach Ost/West) legend(on) percent
I learned that adding the option yline(25) would draw a horizontal line at y=25, and wondered whether I could limit the area on the a axis for every y-value, but couldnt find a way doing so.
Hoping that you can help me out, thanks!
Adam
Comment