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
Error when run heatplot with "function drop() not declared in class ColrSpace (120 lines skipped) " Code: ssc install heatplot Code: ssc install palettes, replace Code: ssc install colrspace, repla…
Fixed effect model for hospital and patietn level data (really need some help)Hi, I am exploring a dataset of patient data from 20 hospitals for 3 years. Among which 9 hospitals…
Removing Leading and Trailing SpacesConsider the following full worked example Code: import delimited "http://qed.econ.queensu.ca/jae/d…
Asymptomatic/Finite Sample analysisThis may not be the forum for this- perhaps Cross- Validated, but I don't have a Stata question as m…
reshape errorDear Stata users, I am facing problem with -reshape wide- command. More specifically, I would like …
Subscribe to:
Post Comments (Atom)
0 Response to Very strange non-unique merge error
Post a Comment