your jags code is not correct in how it deals with cencoring.
n = 1000
x = rnorm(n, sd = 0.5)
lambda = exp(1+x)
yy = rexp(n, rate=lambda)
ys <- rexp(n, rate = exp(1))
y <- pmin(yy, ys)
event <- as.numeric(ys > yy)
data = list(y=y, event=event, x=x)
summary(inla(inla.surv(y,event) ~ x,
family ="exponential.surv",
control.family = list(link = list(model = "neglog")),
data=data))
library(survival)
summary(survreg(Surv(y, event) ~ x, data=data, dist="exponential"))
> --
> You received this message because you are subscribed to the Google
> Groups "R-inla discussion group" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
r-inla-discussion...@googlegroups.com.
> To view this discussion on the web, visit
>
https://groups.google.com/d/msgid/r-inla-discussion-group/2337c061-32a2-4bf1-a044-ea5419343be4n%40googlegroups.com
> .
--
Håvard Rue
he...@r-inla.org