Hello,
I'm sorry that this question is so simple, but I have tried and tried and do not know what to do:
In my dataset, I have a mix of information from two sources, marked by variable "source" (source== 1 | 2) about hospital admissions. Many of the observations talk about the same patient (as given by the variable MRN) and some talk about the same hospitalization (encounter). While MRN denotes the row referring to the same patient, another variable, "encounter", is unique to each separate hospitalization of each patient.
I want to do the following:
generate a variable (encounter_match) that equals "1" each time that there is a duplicate value of "encounter" (where one of the instances is in a row where source==1 and the other instance is in a row where source==2)
Can you help me do this?
Thanks,
Michael
I'm sorry that this question is so simple, but I have tried and tried and do not know what to do:
In my dataset, I have a mix of information from two sources, marked by variable "source" (source== 1 | 2) about hospital admissions. Many of the observations talk about the same patient (as given by the variable MRN) and some talk about the same hospitalization (encounter). While MRN denotes the row referring to the same patient, another variable, "encounter", is unique to each separate hospitalization of each patient.
I want to do the following:
generate a variable (encounter_match) that equals "1" each time that there is a duplicate value of "encounter" (where one of the instances is in a row where source==1 and the other instance is in a row where source==2)
Can you help me do this?
Thanks,
Michael
Comment