I am trying to convert a list of observation for censored data to a proper format for survival analysis in R. To give an exemple, the code should transform like this.
event.6mo event.12mo event.24mo
1 0 0 0
2 0 1 NA
3 0 0 1
where each line describes a patient, 0= no event at that time point, 1=event and columns refer to 6, 12, 24 months observations.
and transform to:
event censored
1 24 0
2 12 1
3 24 1
Thanks in advance!