This is my first post on this forum and I am happy to join this community. First, I wish to apologise if any of the previous content in this forum could have been of help. I have actually searched for a solution and read many replies, but I was not able to find one applicable to my need.
In my dataset, I have two observations for each subject. Each observation represents a clinical visit. Data on vital status have been obtained by a National Registry.
For each observation, I have information recorded in these variables:
This is my first time with multiple records for patient, and my problem is that I need to set the date of the last visit (i.e. last registration) as index date of the analysis, while I obtain:
I actually need another interval:
I tried to specify origin as no_reg ==2, but there are several observations beginning on or after exit, while if I drop the first registration and I use the stset command, I do not have exclusions and everything comes smooth.
I tried also to modify my data, so that the death status was only valued in the second registration, and time_death was the same in first and second visit, based on the value of the second visit, but none has been successful.
Thanks in advance for your help.
In my dataset, I have two observations for each subject. Each observation represents a clinical visit. Data on vital status have been obtained by a National Registry.
For each observation, I have information recorded in these variables:
- id_patient, which is the subject identificator
- no_reg, which identifies if present observation is the first (no_reg == 1) or the last one (no_reg == 2)
- visit_date, which is the date of the visit
- out_death, and out_death == 1 means that the patient is known to be dead when the dataset has been released
- time_death, which is the time from the date of that visit to death.
Code:
stset time_death, failure(out_death=1) scale(365.25) exit (time 1826.25) id(id_patient)
Code:
Observed time interval: (time_death[_n-1], time_death]
Code:
(time_death(_N), time death)
I tried also to modify my data, so that the death status was only valued in the second registration, and time_death was the same in first and second visit, based on the value of the second visit, but none has been successful.
Thanks in advance for your help.
Comment