Dear everyone,
I am trying to create a bar graph, but have several expenditure variables that I fail to show in a combined graph.
I am working with panel data and would like to show this table as example for the data structure:
Now I attempted to create a graph. I will attach a sketch of my idea below the text, but am also going to explain my idea in case the picture can't be shown correctly.
On the y axis, I want to show the expenditures numbers. I found some advice in this forum regarding the long format and using a stack command, but my experience in using long-form data is extremely limited. The only way I managed to create the long form was connected to also dropping the management variable.
On the x Axis, I would like to see the names of the expenditure types. Like Food, Clothing, etc.
The bars above each expenditure type should always be in one color for the mean expenditure of management group 1, and another color for the mean expenditure of management group 0.
My numerous attempts to create this chart led me to various issues that left me with code that is so far from being helpful here, that I am not attaching any of my tries. But please let me know, if I missed providing information necessary to help me.
Thank you already for your feedback.
Here is the sketch:

I am trying to create a bar graph, but have several expenditure variables that I fail to show in a combined graph.
I am working with panel data and would like to show this table as example for the data structure:
id | year | food expenditure | clothing expenditure | education expenditure | ... | Management Type |
1 | 2017 | 63 | 11 | 24 | 1 | |
1 | 2018 | 62 | 12 | 22 | 1 | |
1 | 2019 | 67 | 14 | 21 | 0 |
On the y axis, I want to show the expenditures numbers. I found some advice in this forum regarding the long format and using a stack command, but my experience in using long-form data is extremely limited. The only way I managed to create the long form was connected to also dropping the management variable.
On the x Axis, I would like to see the names of the expenditure types. Like Food, Clothing, etc.
The bars above each expenditure type should always be in one color for the mean expenditure of management group 1, and another color for the mean expenditure of management group 0.
My numerous attempts to create this chart led me to various issues that left me with code that is so far from being helpful here, that I am not attaching any of my tries. But please let me know, if I missed providing information necessary to help me.
Thank you already for your feedback.
Here is the sketch:
Comment