Announcement

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

  • How do I merge 2 different rows in STATA (long format data) based on their date of diagnosis of a disease?

    Hi Everyone,
    I am a graduate student and new to STATA. I am working on a population based big data set that includes records for 3 different diseases (A, B, C) for several individuals. One individual can have multiple records of 1, 2 or all three of these diseases. The data is in long format and the record for each disease is in a different row with name of the disease and its date of diagnosis. My question is that, suppose for an individual, if there are two rows (1 for disease A and another for B) and both of them were diagnosed on the same date. I want to collapse the 2 rows into one row and rename it to coinfection with A & B. I would really appreciate if someone can guide me with how can I do that in STATA? what command should I use?
Working...
X