I have population data for a country per year. Currently, there is three year-observations per country which I would like to condense so that there is one row per country-year. Here is how the data looks like:
As I have many countries in the dataset, I would like to automatize the process so I can get something like:
I was approaching the problem from removing duplicates to "bysort-ing" and dropping observations perspective, but I cannot get it properly working.
Was having trouble tracking down specific guidance for this, so thank you so in advance for the help offered.
| Year | Country Name | population level 1 | population level 2 | population level 3 |
| 1989 | Italy | 1117967 | . | . |
| 1989 | Italy | . | 1922792 | . |
| 1989 | Italy | . | . | 155041 |
| Year | Country Name | population level 1 | population level 2 | population level 3 |
| 1989 | Italy | 1117967 | 1922792 | 155041 |
| 1990 | Italy | xxx | yyy | zzz |
| 1991 | Italy | mmm | nnn | ddd |
Was having trouble tracking down specific guidance for this, so thank you so in advance for the help offered.

Comment