I'm trying to estimate two survival models together using inla(). It works well when I specify the two survival models to be Weibull distributed, i.e., family = c('weibullsurv', 'weibullsurv'). However, I had an error when I tried to use a random walk as the baseline hazard and specified family = c('coxph', 'coxph'). The error message is: "For survival models, the response has to be of class inla.surv; you have list."
Here is a simple version of my code:
>y.r = inla.surv(time = c(time.r, rep(NA, n2)), event = c(event.r, rep(NA, n2)))
>y.t = inla.surv(time = c(rep(NA, n1), time.t), event = c(rep(NA, n1),event.t))
>y.joint = list(y.r, y.t)
>linear.covariate = data.frame(x.r = c(data$x, rep(0, n2)),
x.d = c(rep(0, n1), data.d$x))
>data.f = c(linear.covariate)
>data.f$Y = y.joint
>formula = Y ~ -1 + x.r + x.d
>inla.model = inla(formula, family = c("coxph", "coxph"),
data = data.f)
Thank you!