Hi I've used rangejoin before and never had issues.
Somehow this time it won't work
Dataset1 : admissiondate uniqueid gender - variables
Dataset2: surgerydate uniqueid gender
UniqueId in both datasets are the same. However in dataset2, there are several duplicate uniqueids and therefore not unique values. I want to try and eliminate those duplicate uniqueids that have incorrect information.
Aim: To bring admission date from Dataset1 onto Dataset2 for each uniqueid that is found in both Dataset 1 and Dataset2 using UniqueID and Gender otherwise it is tagged as missing.
Following this I will then check which ones have admissiondate=surgerydate. If != that it is tagged and then dropped.
Error: was expecting a numeric variable, a number or a system missing value for the interval low
I used the above same code for another rangejoin and never had issues
admissiondate - stata date
uniqueid - double
gender double
Somehow this time it won't work
Dataset1 : admissiondate uniqueid gender - variables
Dataset2: surgerydate uniqueid gender
UniqueId in both datasets are the same. However in dataset2, there are several duplicate uniqueids and therefore not unique values. I want to try and eliminate those duplicate uniqueids that have incorrect information.
Aim: To bring admission date from Dataset1 onto Dataset2 for each uniqueid that is found in both Dataset 1 and Dataset2 using UniqueID and Gender otherwise it is tagged as missing.
Following this I will then check which ones have admissiondate=surgerydate. If != that it is tagged and then dropped.
Code:
clear all use "dataset1" rangejoin admissiondate using "Dataset2", by (uniqueid gender)
I used the above same code for another rangejoin and never had issues
admissiondate - stata date
uniqueid - double
gender double
Comment