Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- formula.mod2 = hazstd ~ f(agc, model = "rw2") +
- f(district, model="besag", graph = g, param = c(1,0.01)) +
- f(distr.unstruct, model="iid", param = c(1,0.01)) +
- edu1 + edu2 + tpr + sex + bmi
- mod2 = inla(formula.mod2, data = Zambia, control.family = list(initial = 1),
- control.inla = list(h = 1e-4),
- control.compute = list(dic = TRUE,cpo=TRUE),
- verbose = TRUE)
- names(mod2$summary.random$agc)
- summary(mod2$summary.random$agc$"0.5quant")
- library("ggplot2")
- mydata <- as.data.frame(mod2$summary.random$agc)
- ggplot(mydata) +
- geom_line(aes(ID, `0.5quant`)) +
- geom_line(aes(ID, `0.025quant`), linetype="dashed") +
- geom_line(aes(ID, `0.975quant`), linetype="dashed")
Add Comment
Please, Sign In to add comment