##Code for Exponential Model 
data=read.table("Kidney-infec.txt", header = T)

## The routines in R-INLA work with objects of class "inla.surv",
## which is a data structure that combines times, censoring and
## truncation information Here we have right censored data and thus
## the time is represented in this way
inla.surv(data$time, data$event)
formula = inla.surv(time, event) ~ placement
model = inla(formula,family="exponentialsurv", data= data, verbose=TRUE)
 
## Code for Weibull Model example
data=read.table("Kideny-infec.txt", header = T)
inla.surv(data$time, data$event)
formula = inla.surv(time, event) ~ placement
model = inla(formula,family="weibullsurv", data= data, verbose=TRUE )
