| ridgeprevPlot | R Documentation |
static ridge plot for posterior densities
ridgeprevPlot(
res.obj,
admin1.focus = NA,
plot.extreme.num = 8,
legend.label = "Value",
color.reverse = T,
plot.format = c("Long", "Wide")[1],
top.bottom.label = c("Top", "Bottom")
)
res.obj |
result object from surveyPrev |
admin1.focus |
whether to plot densities for regions within a single upper admin |
plot.extreme.num |
number of regions to plot for the top n and bottom n regions |
legend.label |
label on the legend |
color.reverse |
whether to reverse color scheme |
plot.format |
c('Long','Wide') for extreme regions, side-by-side or long plot |
top.bottom.label |
c('Top','Bottom') how to name the extremes, top 10 bottom 10? need to change when close to 0 is bad for the indicator |
ggplot2 object
## Not run:
geo <- getDHSgeo(country = "Zambia", year = 2018)
cluster.info <- clusterInfo(geo = geo,
poly.adm1 = ZambiaAdm1,
poly.adm2 = ZambiaAdm2)
# "RH_ANCN_W_N4P" is an indicator for having more than four ANC visits.
# In previous versions of the package, it is labeled "ancvisit4+".
dhsData <- getDHSdata(country = "Zambia",
indicator = "RH_ANCN_W_N4P",
year = 2018)
data <- getDHSindicator(dhsData, indicator = "RH_ANCN_W_N4P")
poly.adm1 <- sf::st_as_sf(ZambiaAdm1)
admin.info1 <- adminInfo(poly.adm = poly.adm1,
admin = 1,
by.adm = "NAME_1")
cl_res_ad1 <- clusterModel(data=data,
cluster.info = cluster.info,
admin.info = admin.info1,
stratification = FALSE,
model = "bym2",
admin = 1,
aggregation = TRUE,
CI = 0.95)
ridgeprevPlot(cl_res_ad1, plot.extreme.num=5)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.