Hi everyone,
I'm having trouble with merging two datasets. The first one "anes_timeseries_cdf_stata12.dta" has survey data and different questions. The second one "faminc_raw.dta" has fewer variables and all I'm interested in is the gini coefficient variable. So I'm trying to use the m:1 command to merge the second into the first, using the common variable they both have, "year", but I keep getting the message "Variable year does not uniquely identify observations in the using data". This was my command:
use "anes_timeseries_cdf_stata12.dta"
merge m:1 year using "faminc_raw.dta"
The year variable for the first data set looks like this:

and the year variable for the second dataset looks like this:

What am I doing wrong please?
Thank you!
I'm having trouble with merging two datasets. The first one "anes_timeseries_cdf_stata12.dta" has survey data and different questions. The second one "faminc_raw.dta" has fewer variables and all I'm interested in is the gini coefficient variable. So I'm trying to use the m:1 command to merge the second into the first, using the common variable they both have, "year", but I keep getting the message "Variable year does not uniquely identify observations in the using data". This was my command:
use "anes_timeseries_cdf_stata12.dta"
merge m:1 year using "faminc_raw.dta"
The year variable for the first data set looks like this:
and the year variable for the second dataset looks like this:
What am I doing wrong please?
Thank you!
Comment