0
votes

This is my model:

library(eha)
fit.aft <- aftreg(formula = Surv(time, status) ~ age + sex, data = kidney,
                  dist = "lognormal")

however this is what I see if I want to use predict:

predict(fit.aft)

Error in UseMethod("predict") : no applicable method for 'predict' applied to an object of class "c('aftreg', 'phreg')"

Could someone let me know how to predict in using survival models.

1
predictSurvProbcuttlefish44

1 Answers

0
votes

The survreg function in {survival} fits accelerated failure time models, so:

library(survival)
fit.aft <- survreg(formula = Surv(time, status) ~ age + sex, data = kidney,
                  dist = "lognormal")
predict(fit.aft, type = "lp")

Will predict the linear predictor. If you want survival probability predictions then you have to use other packages, like {pec} or {mlr3proba}.