Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Duplicates (same patient) with different scores within a time frame

    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!

  • #2
    Blake:
    welcome to this forum.
    As per your description, it seems that you are dealing with an unbalanced panel dataset.
    I'd take a look at -xt- suite commands in Stata .pdf manual.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment

    Working...
    X