3
$\begingroup$

I'm currently working with accelerated time failure models. However, when I fit a model using survreg in R, the predict function only seems to return expected lifetime.

I'm wondering how one can use a fitted accelerated time failure model to predict probability of survival within a given time interval, conditional on covariates and time already survived.

That is, I would like to know:

enter image description here

Ideally, I would have a predict function that accepts a fitted model object, the times in question, and new data containing covariates as arguments. The function then returns probability of survival up to each time, i.e. the conditional survival function, for each observation in the new dataset.

Edit To make this reproducible:

lfit <- survreg(Surv(time, status) ~ ph.ecog, data=lung)
pct <- 1:98/100 # The 100th percentile of predicted survival is at +infinity
ptime <- predict(lfit, newdata=data.frame(ph.ecog=2), type='quantile',
             p=pct)

ptime contains the number of days associated with each percentile. I want the inverse: to supply a time value and get the probability of survival.

$\endgroup$

1 Answer 1

2
$\begingroup$

There are several ways to do this including

summary(lfit, ...)
require(rms)
f <- psm(Surv(time, status), ...)
survest(f, ...)
S <- Survival(f) # derive fitted survival function analytically in R notation
S( )
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.