I am trying to merge panel data from the Understanding Society Survey with macroeconomic data. The panel data from Understanding Society has :
- participant's ID number,
- year they were interviewed,
- country they were born in,
- life satisfaction score.
There are 10 observations per individual (followed over 10 years).
I am trying to merge this data with macroeconomic data which has 3 variables:
- GDP,
- year,
- country.
I want to merge these datasets by year and country. I made sure that the variables year and country were consistent between the two datasets. I thought that a m:1 merge
in stata would do the trick, but I got the error :
variables year country do not uniquely identify observations in the using data.
I want my panel data to include the GDP of each individual's birth country in the specific year they were interviewed. How can I achieve this?