I am trying to use the "rpart" package in R to build a survival tree, and I hope to use this tree to then make predictions for other observations.
I know that there were many SO questions related to rpart and prediction; however, I could not find any address for the problem that (I think) is specific to using rpart with the "Surv" object.
My particular problem is with the interpretation of the results of the predict function. An example is useful:
library(rpart)
library(OIsurv)
set.seed(4)
dat = data.frame(X1 = sample(x = c(1,2,3,4,5), size = 1000, replace=T))
dat$t = rexp(1000, rate=dat$X1)
dat$t = dat$t / max(dat$t)
dat$e = rbinom(n = 1000, size = 1, prob = 1-dat$t )
sfit = survfit(Surv(t, event = e) ~ 1, data=dat)
plot(sfit)
tfit = rpart(formula = Surv(t, event = e) ~ X1 , data = dat, control=rpart.control(minsplit=30, cp=0.01))
plot(tfit); text(tfit)
dat$node = as.factor(tfit$where)
plot( survfit(Surv(dat$t, event = dat$e)~dat$node) )
. , , , rpart . , , , predict(tfit), , . , , predict(fit)[1] .46, , P(s) = exp(−λt), λ=.46.
, . ( ) , / . (EDIT: , , , - /, . , ).
, ...
rates = unique(predict(tfit))
for (rate in rates) {
grid= seq(0,1,length.out = 100)
lines(x= grid, y= exp(-rate*(grid)), col=2)
}

, , , , survfit . . , ( ) "rate" ( ) .
, , : , X - .
, , , , rpart/survival . - (1) rpart (2) ?