rankPlot: Get ranking plot of model results

View source: R/rankPlot.R

rankPlotR Documentation

Get ranking plot of model results

Description

This function return scatter plot at admin 1 or 2 level for given model results.

Usage

rankPlot(x, direction = 1)

Arguments

x

a model result using surveyPrev of class "fhModel" or "clusterModel"

direction

direction of the ranking. The default is direction = 1, which correspond to larger value having higher ranking. If direction = -1, larger value has lower ranking.

Value

This function returns a ranking plot.

Author(s)

Zehang Li, Qianyu Dong

Examples

## Not run: 

geo <- getDHSgeo(country = "Zambia", year = 2018)
data(ZambiaAdm1)
data(ZambiaAdm2)
data(ZambiaPopWomen)
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")
admin.info2 <- adminInfo(poly.adm = ZambiaAdm2,
                        admin = 2,
						   by.adm="NAME_2",
						   by.adm.upper = "NAME_1")
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)
rankPlot(cl_res_ad2_unstrat)


## End(Not run)


surveyPrev documentation built on June 19, 2026, 5:06 p.m.