hello, i'm new to the forums and rather new to stata,
I have data that is arranged by country and by year. There are 30 countries in the data set. What I would like to be able to do is to generate all combinations of size 27 out of the 30 countries and sum values together in the combination. This should be 30 choose 27 so ~4000.
For example, my data looks kind of like this
Country Year GDP
AUS 1999 4000
AUS 2000 50000
AUS 2001 6000
USA etc etc.
USA
USA
GBR
GBR
GBR
MEX
MEX
MEX
....
I would like to be able to select 27 countries and then add GDP in each year and I would like to do this for all possible combinations. I looked into egen to do this, but wasn't exactly sure. Any help is much appreciated!!
I have data that is arranged by country and by year. There are 30 countries in the data set. What I would like to be able to do is to generate all combinations of size 27 out of the 30 countries and sum values together in the combination. This should be 30 choose 27 so ~4000.
For example, my data looks kind of like this
Country Year GDP
AUS 1999 4000
AUS 2000 50000
AUS 2001 6000
USA etc etc.
USA
USA
GBR
GBR
GBR
MEX
MEX
MEX
....
I would like to be able to select 27 countries and then add GDP in each year and I would like to do this for all possible combinations. I looked into egen to do this, but wasn't exactly sure. Any help is much appreciated!!
Comment