I have survival data on patients, coming from a clinic's datawarehouse. I want to do a survival analysis. The timeframe starts on the day a patient gets a certain examination, and ends 730 days (two years) later.
The data comes in with timestamps.
|B||01.02.2000||NA||01.03.2000||Lost to followup|
|C||01.03.2000||01.04.2000||01.04.2000||Died during study|
|D||01.04.2000||01.04.2010||01.04.2010||Died after study|
So far, I have transformed the data to have the length of actual survival times, and an event column.
|B||NA||FALSE||Lost to followup|
|C||31||TRUE||Died during study|
|D||3653||FALSE||Died after study|
Surv seems to take no argument for a time of last contact, so I am quite certain that I should at least make a correction for patient B, who was lost to followup, and enter 28 there (the duration between examination and last contact). Patient C is also quite clear: died during the study, and the duration until death is entered.
But my question is about the other two patients:
- should I enter 730 (the study duration) for patients like A, who lived beyond the end of the study?
- should I enter 730 for patients like D, who died after the study timeframe? Note that I have already set the event column to FALSE for these cases.
I read some examples on how to use the survival package, but they used very simplified cases with already-prepared datasets.