Announcement

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

  • Dealing with multiple deaths

    I have a dataset with observations regarding clinical patients. In some cases there are multiple admissions for the same patient. Every admission corresponds to one observation. That means that the number of observations is higher than the number of patients in the dataset. E.g. some patients have been admitted more than once during the study period.

    The objective is to calculate the 90-day mortality. However, due to some patients having multiple admissions (and thus observations) the program interprets some patients having experienced multiple deaths. For example: A patient gets admitted day 1 and gets discharged day 7. The same patient gets admitted day 14 and passes away day 21. This patient receives two observations, one where the patient was admitted day 1 och one at day 14. The problem is that STATA then thinks that the patient has died twice, since both observations lead to death within 90 days. This problem always occurs if a patient experience frequent admissions and a following death that overlaps multiple observations within 90 days.

    The question is: How can I filter out these cases where patients have frequent admission and a following death leading to this error in the statistics? I would like to create a variable where I can see “the number of deaths” for a patient and later being able to decide if I only want to keep these patients’ first admission or maybe fill in the later admissions as missing value on mortality. I have variables for admission date and time, patient-ID, mortality etc.

    Thanks in advance!

  • #2
    Code:
    bys patient_ID: gen total_admissions=_N
    bys patient_ID (admission_date): gen which=_n
    See also https://www.statalist.org/forums/help#spelling

    Comment

    Working...
    X