Dear Stata users,
I have panel data for 32 countries from 1990-2012.
I used this code to create averages so I get a graph with the development for the greenhouse gas emissions.
However, I want to create an if condition so I can look at the development of the average greenhouse gas emissions for a smaller set of countries per year.
I tried:
But this does not seem to work.
Thank you in advance!
I have panel data for 32 countries from 1990-2012.
I used this code to create averages so I get a graph with the development for the greenhouse gas emissions.
Code:
bysort year: egen average_GHG = mean(GHG)
I tried:
Code:
bysort year: egen average_GHG = mean(GHG) if inlist(countryid, 4, 24, 14, 15, 6, 26)
Thank you in advance!

Comment