if (FALSE) {
geo <- getDHSgeo(country = "Zambia", year = 2018)
data(ZambiaAdm1)
data(ZambiaAdm2)
data(ZambiaPopWomen)
cluster.info <- clusterInfo(geo = geo,
poly.adm1 = ZambiaAdm1,
poly.adm2 = ZambiaAdm2)
dhsData <- getDHSdata(country = "Zambia",
indicator = "ancvisit4+",
year = 2018)
data <- getDHSindicator(dhsData, indicator = "ancvisit4+")
admin.info2 <- adminInfo(poly.adm = ZambiaAdm2,
admin = 2,
agg.pop =ZambiaPopWomen$admin2_pop,
proportion = ZambiaPopWomen$admin2_urban)
cl_res_ad2_unstrat <- clusterModel(data = data,
cluster.info = cluster.info,
admin.info = admin.info2,
stratification = FALSE,
model = "bym2",
admin = 2,
aggregation = TRUE,
CI = 0.95)
head(cl_res_ad2_unstrat$res.admin2)
head(cl_res_ad2_unstrat$agg.admin1)
plots <- intervalPlot(cl_res_ad2_unstrat)
plots[["Central"]]
cl_res_ad2 <- clusterModel(data = data,
cluster.info = cluster.info,
admin.info = admin.info2,
stratification = TRUE,
model = "bym2",
admin = 2,
aggregation = TRUE,
CI = 0.95)
head(cl_res_ad2$res.admin2)
head(cl_res_ad2$agg.admin1)
plots <- intervalPlot(cl_res_ad2)
plots[["Central"]]
library(patchwork)
wrap_plots(plots, ncol = 5)
}
Run the code above in your browser using DataLab