I'm sorry if the question looks silly, but I have a small data set which I would like to manipulate with function "survfit" of R package "survival", and, well, I don't know to set a proper dataframe usable by "survfit"; data are as follows:
time number_at_risk number_death number_censored
1 25 10 0 2
2 28 8 1 0
3 33 7 1 0
4 37 6 0 1
5 41 5 1 0
6 43 4 0 1
7 48 3 0 3
And now, if I run the usual syntax survfit(Surv(time, number_censored) ~ 1, data = data)
, it gives me the warning In Surv(time, number_censored) : Invalid status value, converted to NA
.
Obviously, the data are not properly organized. So, how should I set my dataframe? Thanks.