I'm merging two datasets (let's call them DatasetA and DatasetB) by two string variables: "journal" and "field". Both DatasetA and DatasetB are "isid journal field".
When I open DatasetA and run:
merge 1:1 journal field using DatasetB
I get the error "variables journal field do not uniquely identify observations in the master data".
BUT I have run "isid journal field" right before the merge, verified that nothing is missing with "assert !missing(journal,field)" and even run "bys journal field: keep if _n==1". For completeness, I have also done this in the using dataset. All the checks pass and nothing gets dropped with the "keep" command, but I still get the error. I get this error in Stata 15 and Stata 16.
Any ideas as to what could be going on are welcome!
Related Posts with Very strange non-unique merge error
How can I covert Oaxaca-Decomposition coef. into an amount(dollar...)?I got the following results through oaxaca two-fold method. ---------------------------------------…
landmark analysis differences between time-periodsHello everyone, I have a cohort with 1 group (no comparison group). I created a landmark analysis …
variable name abbreviation in generate/replace sequenceThere seems to be some inconsistency about how to abbreviate variable names. I would like to abbrevi…
Lexis Diagram- Not able to make Parallelograms to show follow up of cohortDear Stata Users I am quite new to stata and using version 15.1 in mac. I have been trying to make L…
Reshaping and stackingDear all I just hit a wall to try to rearrange some data, trying stack, reshape, withouth success …
Subscribe to:
Post Comments (Atom)
0 Response to Very strange non-unique merge error
Post a Comment