if (FALSE) {
## load zambia data and map
data("ZambiaNutrition")
data("ZambiaBnd")
## estimate model
zm <- bayesx(stunting ~ memployment + meducation + urban + gender +
sx(mbmi) + sx(agechild) + sx(district, bs = "mrf", map = ZambiaBnd) +
sx(district, bs = "re"), iter = 12000, burnin = 2000, step = 10,
data = ZambiaNutrition)
summary(zm)
## plot smooth effects
plot(zm, term = c("sx(bmi)", "sx(agechild)", "sx(district)"), map = ZambiaBnd)
## for more examples
demo("zambia")
}
Run the code above in your browser using DataLab