Parametric survival in R

37 views Asked by At

I have been trying to do a survival forecast at 5 years using a parametric model (Weibull), but I am having problems calculating a 95% CI.

I tried (using the dataset lung that comes with survival):

library(survival)
model <- survreg(Surv(time,status)~1, data=lung)
time_days <- c(365.25*1, 365.25*3, 365.25*5)
md_scale <- predict(model, newdata=data.frame(time_days), type="link")
surv_pred <- 1-pweibull(time_days, shape=1/model$scale, scale=exp(md_scale)

I got the prediction, but after looking online cannot find a way to calculate the confidence intervals for those values.

Thank you for your help

0

There are 0 answers