Dear stata users,
I have panel data for 32 countries from 1990-2012.
I want to create a graph which shows the evolution of a variable for a specific set of countries and the average. In my case it is about green house gas emissions (GHG).
So, basically I want 3 lines:
- The evolution of GHG for all OECD countries together over the years
- The evolution of GHG for all BRICS countries together over the years
- The evolution of GHG for all countries total over the years
I tried the command below, which will give me a graph of the briics countries (Brazil (4), russia (24), etc), but all seperate lines. Is there a way to make an average out of these countries into one line?
Do I have to make a new variable? If so, how?
Or is there a command I can use to create the graph I want.
Thank you in advance!
I have panel data for 32 countries from 1990-2012.
I want to create a graph which shows the evolution of a variable for a specific set of countries and the average. In my case it is about green house gas emissions (GHG).
So, basically I want 3 lines:
- The evolution of GHG for all OECD countries together over the years
- The evolution of GHG for all BRICS countries together over the years
- The evolution of GHG for all countries total over the years
I tried the command below, which will give me a graph of the briics countries (Brazil (4), russia (24), etc), but all seperate lines. Is there a way to make an average out of these countries into one line?
Do I have to make a new variable? If so, how?
Or is there a command I can use to create the graph I want.
Code:
xtline GHG if inlist(countryid, 4, 24, 14, 15, 6, 26), overlay
Comment