10.3 Modeling diseased risk
Yi|θi∼Poisson(Ei×θi)
where
θi is the relative risk for county i,
ui is the structured random effect for county i modeled with an intrinsic conditional autoregressive (ICAR) model,
ui|u−i∼N(ˉuδi1τunδi)
- vi is the random effect for stratum i
vi∼N(0,1τv)
10.3.2 Model
formula <- Y ~ smoking +
f(re_u,
model = "besag",
graph = g,
scale.model = TRUE) +
f(re_v, model = "iid")
res <- inla(formula,
family = "poisson",
data = map,
E = E,
control.predictor = list(compute = TRUE),
control.compute = list(return.marginals.predictor = TRUE))
res$summary.fixed
mean sd 0.025quant 0.5quant
(Intercept) -0.3235 0.1498 -0.61925 -0.3233
smoking 1.1546 0.6226 -0.07569 1.1560
0.975quant mode kld
(Intercept) -0.02877 -0.3234 3.534e-08
smoking 2.37845 1.1563 3.545e-08
10.3.3 Relative Risk
res$summary.fitted.values[1:3, ]
mean sd 0.025quant 0.5quant
fitted.Predictor.01 0.8781 0.05808 0.7648 0.8778
fitted.Predictor.02 1.0597 0.02750 1.0072 1.0592
fitted.Predictor.03 0.9646 0.05089 0.8604 0.9657
0.975quant mode
fitted.Predictor.01 0.9936 0.8778
fitted.Predictor.02 1.1150 1.0582
fitted.Predictor.03 1.0622 0.9681
# relative risk
map$RR <- res$summary.fitted.values[, "mean"]
# lower and upper limits 95% CI
map$LL <- res$summary.fitted.values[, "0.025quant"]
map$UL <- res$summary.fitted.values[, "0.975quant"]
See the map here:
https://www.paulamoraga.com/book-spatial/disease-risk-modeling.html#mapping-smr