I'm trying to plot a Kaplan-Meier curve of my data with R. Currently, the data is in the following format:
patient_id;number_of_days;survival 1 ;100 ;T 1 ;200 ;F 1 ;300 ;F 2 ;50 ;F ...
Survival in my context is not to be interpreted literally: it means progression of disease, which is only assessed at more or less equally spaced time-points.
I'm having trouble determining what the
Surv function expects as input? How am I supposed to prepare the data?
I've tried feeding my data directly to
However this seems to count each patient multiple times (once per time-point). So my guess is that I must apply some kind of transformation to my data first. I'm fairly certain this problem of converting longitudinal data to "event data" must be fairly common, so how is this called? Is it already implemented somewhere?