# NOT RUN {
library(INLA)
data(Epil)
observed <- Epil[1:30, 'y']
Epil <- rbind(Epil, Epil[1:30, ])
Epil[1:30, 'y'] <- NA
## make centered covariates
formula = y ~ Trt + Age + V4 +
f(Ind, model="iid") + f(rand,model="iid")
result = inla(formula, family="poisson", data = Epil,
control.predictor = list(compute = TRUE, link = 1))
plot_inla_residuals(result, observed)
data(Seeds)
l <- nrow(Seeds)
Seeds <- rbind(Seeds, Seeds)
Seeds$r[1:l] <- NA
formula = r ~ x1 * x2 + f(plate, model = "iid")
mod.seeds = inla(formula, data=Seeds, family = "binomial", Ntrials = n,
control.predictor = list(compute = TRUE, link = 1))
plot_inla_residuals(mod.seeds, na.omit(Seeds$r / Seeds$n))
# }
Run the code above in your browser using DataLab