Hi All,
I am trying to merge two large datasets (from 1996-2018) namely lfs_append_all.dta and rams_append.dta. Both of these datasets contain person_id, firm_id, plant_id and year. I want to merge the datasets using these 4 keys. Each dataset has only one observation for each person_id, firm_id, plant_id and year. Both dataset contains multiple observation per firm_id, plant_id and year. The command I am using is below:
clear all
set more off
set seed 12345
use "P:\2021\15\Zariab\lfs_append_all"
merge 1:1 person_id firm_id plant_id year using "P:\2021\15\Zariab\rams_append", nogen
However, I am getting the following result:
variables person_id firm_id plant_id year do not uniquely identify observations in the master data
r(459);
I do not have a clear understanding what is going wrong. Any help would be highly appreciated. I sorted the data by person_id, firm_id, plant_id and year.
Thanks in advance!
Zariab Hossain
Uppsala University
I am trying to merge two large datasets (from 1996-2018) namely lfs_append_all.dta and rams_append.dta. Both of these datasets contain person_id, firm_id, plant_id and year. I want to merge the datasets using these 4 keys. Each dataset has only one observation for each person_id, firm_id, plant_id and year. Both dataset contains multiple observation per firm_id, plant_id and year. The command I am using is below:
clear all
set more off
set seed 12345
use "P:\2021\15\Zariab\lfs_append_all"
merge 1:1 person_id firm_id plant_id year using "P:\2021\15\Zariab\rams_append", nogen
However, I am getting the following result:
variables person_id firm_id plant_id year do not uniquely identify observations in the master data
r(459);
I do not have a clear understanding what is going wrong. Any help would be highly appreciated. I sorted the data by person_id, firm_id, plant_id and year.
Thanks in advance!
Zariab Hossain
Uppsala University
Comment