I am working with two panel datasets with which I am trying to perform a 1:1 merge. Ultimatly, I want to add the variable fiscal year to my master dataset. My merging variables are FIRM_ID, DATE, and PERSON_ID. Hence, my code looks like
Code:
merge 1:1 firm_id date person_id using "...\file.dta", keep(master match) nogenerate
The merging process itself works well. However, one out of eight years does not merge properly. Taking a look at the population of the variable in the master and the using dataset might help to explain the problem:
This is how fiscal year is populated in the using dataset
Array
And this is how it is populated in the master dataset after the merge
Array
Apparantly, the merging works quiet well except for the fiscal year 2009.
Of course, I have already compared the observations which did not match. However, the observations occur in both datasets and 2009 should be as populated as all the other years in the data after the merge. Furthermore, each of the three merging variables have the same format in both datasets. I really do not understand why Stata does not properly merge this one year, whereas all the others work quite well.
Has anyone ever experienced anything similar? Do you have any ideas how to solve the problem?
I would really appreciate your answers.
Best regards,
Sebastian
0 Response to One specific year cannot be merged even though merging variables have the same values in master and using data
Post a Comment