Hi
I am working with a dataset that has 75 years of data. The countries are observations - so every country's name appears 75 times. There are indicator variables that I need to sum for each country.
So I used the following command: collapse (sum) signed enforced terminated signed_high enforced_high, by (country1 year)
/* All the variables above are indicator variables */
However, I do not get the desired result. The summation takes place across all countries. For example, if the sum after the first country is 3, the sum for the second country starts from 4. I'd like to have individual sums for countries. I was wondering if I should be creating a loop for each country but not sure how to do that either.
Here is a glimpse of the data I am currently working with: https://docs.google.com/spreadsheets...it?usp=sharing
Thanks
I am working with a dataset that has 75 years of data. The countries are observations - so every country's name appears 75 times. There are indicator variables that I need to sum for each country.
So I used the following command: collapse (sum) signed enforced terminated signed_high enforced_high, by (country1 year)
/* All the variables above are indicator variables */
However, I do not get the desired result. The summation takes place across all countries. For example, if the sum after the first country is 3, the sum for the second country starts from 4. I'd like to have individual sums for countries. I was wondering if I should be creating a loop for each country but not sure how to do that either.
Here is a glimpse of the data I am currently working with: https://docs.google.com/spreadsheets...it?usp=sharing
Thanks
Comment