I'm trying to create an actuarial survival analysis in R (I'm following some worked examples). I think the best way to do this is using the survival
package. So something like:
library(survival)
surv.test <- survfit(Surv(TIME,STATUS), data=test)
However, to get the correct answer I will need to divide the TIME
variable into 365 day intervals and I can't quite work out how to do this so it matches the given result.
As far as I can make out, there is no option within the survfit
function that will do this. I went through several document examples and none of them were trying to create a stairstep type of plot (there is a type='interval'
option, but seems to do something different). So I guess I need to regroup my data before I apply the survival
function?
Any ideas?
P.S: In SPSS this would be INTERVAL = THRU 10000 BY 365
; in Stata intervals(365) ... connect(stairsteps)