0

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?

Gowachin
  • 1,251
  • 2
  • 9
  • 17
mvs32
  • 1
  • 1
    Hi, could you provide a reproducible example of your dataset ? See https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – Gowachin May 06 '21 at 09:57
  • Does this answer your question? [Merge multiple data.frames in R with varying row length](https://stackoverflow.com/questions/22023262/merge-multiple-data-frames-in-r-with-varying-row-length) – Gowachin May 06 '21 at 10:01
  • In Stata `duplicates list year country` is one way to follow up the report. – Nick Cox May 06 '21 at 11:21

0 Answers0