Hello Everyone,
I am really struggling to create this graph so would appreciate any help. (Running Stata MP/17)
So I have two dummy variables, healthy21 and healthy19 which equal to 1 if you are healthy in your respective year (2019 or 2021).
I have over 100,000 observations of individuals, which each have either a 1 or 0 assigned to them for healthy19 and healthy21.
Now, I am trying to plot a horizontal bar graph similar to the one below in nature.
Where on the vertical axis I have the town (20 towns, each represented by a number between 1 and 20)
and then on the horizontal axis i have the percentage share of being a healthy person. i.e. two bars per industry one for healthy19==1 and one for healthy21==1
so effectively the graph shows how differences between the share of healthy people between 2019 and 2021 and then also between towns.
this code above works but only the 2019 data. I want the 2021 data to show in the same graph literally side by side each bar (like image below).
any help is really appreciated

I am really struggling to create this graph so would appreciate any help. (Running Stata MP/17)
So I have two dummy variables, healthy21 and healthy19 which equal to 1 if you are healthy in your respective year (2019 or 2021).
I have over 100,000 observations of individuals, which each have either a 1 or 0 assigned to them for healthy19 and healthy21.
Now, I am trying to plot a horizontal bar graph similar to the one below in nature.
Where on the vertical axis I have the town (20 towns, each represented by a number between 1 and 20)
and then on the horizontal axis i have the percentage share of being a healthy person. i.e. two bars per industry one for healthy19==1 and one for healthy21==1
so effectively the graph shows how differences between the share of healthy people between 2019 and 2021 and then also between towns.
Code:
graph hbar (percent) if healthy19==1, over(townid)
any help is really appreciated

Comment