I am getting strange results when I try to collapse country data and I would like to ask your help...
variables: CountryName, CountryID
observations:over 20,000
Goal: there are 115 unique countries in the data and I want to export the unique country names and their IDs.
My data looks like this:
| CountryName | CountryID |
| Albania | 100 |
| Germany | 110 |
| ...etc. for 20,000 entires |
My collapse code:collapse (firstnm) CountryName, by(CountryID)
Problem after this collapse code is that the "CountryID" is no longer a number...it only shows the string:
| CountryName | CountryID |
| Albania | Albania |
| Germany | Germany |
| ...etc. |
Thank you!
0 Response to Collapsing unique country names and country IDs
Post a Comment