I have the dataset below: proportion of the population (variable called prop_pop) in different age groups (variable called grupo) over different years (variable called ano). They sum up to 1 (100%) for a given year.
I would like to create a graph that shows the proportion of the population in each age group for the years available. Hence, each of the years in the horizontal axis should be a stacked bar. I am lost in how I can mix a stacked graph bar with the twoway command and the over option. Could anyone help? Many thanks!
I would like to create a graph that shows the proportion of the population in each age group for the years available. Hence, each of the years in the horizontal axis should be a stacked bar. I am lost in how I can mix a stacked graph bar with the twoway command and the over option. Could anyone help? Many thanks!
Code:
grupo ano prop_pop 0-4 2000 0.1008 0-4 2010 0.0762 0-4 2020 0.0696 0-4 2030 0.0606 0-4 2040 0.0535 0-4 2050 0.0499 0-4 2060 0.0472 40-64 2000 0.2127 40-64 2010 0.2588 40-64 2020 0.2952 40-64 2030 0.3253 40-64 2040 0.3421 40-64 2050 0.3293 40-64 2060 0.3155 5-39 2000 0.6284 5-39 2010 0.5917 5-39 2020 0.5369 5-39 2030 0.4786 5-39 2040 0.4303 5-39 2050 0.4022 5-39 2060 0.3825 65-84 2000 0.0547 65-84 2010 0.0666 65-84 2020 0.0885 65-84 2030 0.1209 65-84 2040 0.1508 65-84 2050 0.1835 65-84 2060 0.2088 85+ 2000 0.0033 85+ 2010 0.0066 85+ 2020 0.0098 85+ 2030 0.0145 85+ 2040 0.0232 85+ 2050 0.0351 85+ 2060 0.0461
Comment