I would like to calculate the probability of surviving three years after surgery. My dataset has four columns:
- date of surgery (
surgery_date
) - date of death (
death_date
) - years to death (
survival
) - censored status (
death
) (1 = patient died, 2 = patient is alive)
Data is structured as follows:
# A tibble: 370 x 4
surgery_date death_date survival death
<date> <date> <dbl> <dbl>
1 2008-03-26 2014-03-21 5.984942 1
2 2008-04-17 NA NA 2
3 2008-05-15 NA NA 2
4 2008-05-15 2014-12-27 6.617385 1
5 2008-05-16 NA NA 2
6 2008-05-23 NA NA 2
7 2008-06-11 NA NA 2
8 2008-06-16 NA NA 2
9 2008-06-18 NA NA 2
10 2008-06-30 NA NA 2
# ... with 360 more rows
I go through various tutorials on the Web where authors assume that we have two variables: time_to_event
variable with exact time to the end of study for each patient and status
variable with censoring status (censored vs. dead). However, in my settings I only have survival times for patients who died.
The question is how to use Kaplan-Meier to compute the probability that a patient will survive the first three years after surgery?