Hi all,
I am looking for help with the following: I have a dataset of patients within a given time frame, and some patients visited more than once (identified by their patient ID-MRN). We are keeping the data from each patient's first visit within the time frame specified by the study and analyzing a patient-reported score and its relationship with other patient variables (which are likely the same/ similar between encounters). Since the patient-reported score may be different between patient encounters for a single patient, I want to be sure that the data is not skewed by excluding the patient's second or third visit.
I have already used the following code (courtesy of this post: https://www.statalist.org/forums/for...cates-by-date- thanks so much!):
bysort MRN (RecordDate): keep if _n==1
However, since this deletes the duplicates, I probably need other code to look at this aspect specifically, as I could see this may be an issue for reviewers.
Thanks for your help!
I am looking for help with the following: I have a dataset of patients within a given time frame, and some patients visited more than once (identified by their patient ID-MRN). We are keeping the data from each patient's first visit within the time frame specified by the study and analyzing a patient-reported score and its relationship with other patient variables (which are likely the same/ similar between encounters). Since the patient-reported score may be different between patient encounters for a single patient, I want to be sure that the data is not skewed by excluding the patient's second or third visit.
I have already used the following code (courtesy of this post: https://www.statalist.org/forums/for...cates-by-date- thanks so much!):
bysort MRN (RecordDate): keep if _n==1
However, since this deletes the duplicates, I probably need other code to look at this aspect specifically, as I could see this may be an issue for reviewers.
Thanks for your help!
Comment