Hi everyone,
I am working with medical record data and have two datasets, demographics.dta and encounters.dta. demographics.dta is comprised of 598 records, with one for each individual represented. In contrast, encounters.dta comprises 905 records for 143 individuals who each had anywhere between 1 and 31 encounters with a specific clinic. What I want to be able to do is generate an indicator variable in demographics.dta to specifically identify the 143 individuals who attended the clinic out of the initial sample of 598.
I have one common identifying variable across the two datasets, mrn (medical record number). In demographics.dta, each mrn only appears once as seen in the first 10 records below:
But in encounters.dta, the same mrn appears multiple times e.g.:
I know that all the individuals I want to identify are included in demographics.dta, is there a method to register this without manually scrolling through and matching by mrn? I have tried to merge the datasets but this just adds more records to demographics.dta and I am unsure how to proceed from here. Any assistance would be greatly appreciated
I am working with medical record data and have two datasets, demographics.dta and encounters.dta. demographics.dta is comprised of 598 records, with one for each individual represented. In contrast, encounters.dta comprises 905 records for 143 individuals who each had anywhere between 1 and 31 encounters with a specific clinic. What I want to be able to do is generate an indicator variable in demographics.dta to specifically identify the 143 individuals who attended the clinic out of the initial sample of 598.
I have one common identifying variable across the two datasets, mrn (medical record number). In demographics.dta, each mrn only appears once as seen in the first 10 records below:
Code:
mrn 571246 662848 680940 774017 774256 774719 774877 775572 775700 776944
Code:
mrn 776944 776944 776944 776944 776944 776944 875626 875626 875626 875626

Comment