map {tipsae} | R Documentation |
Map Relevant Quantities from a Small Area Model
Description
The map()
function enables to plot maps containing relevant model outputs by accounting for their geographical dimension. The shapefile of the area must be provided via a SpatialPolygonsDataFrame
or sf
object.
Usage
map(
x,
spatial_df,
spatial_id_domains,
match_names = NULL,
color_palette = c("snow2", "deepskyblue4"),
quantity = c("HB_est", "Direct_est", "SD"),
time = NULL,
style = "quantile",
...
)
Arguments
x |
An object of class |
spatial_df |
A object of class |
spatial_id_domains |
A character string indicating the name of |
match_names |
An encoding two-columns |
color_palette |
A vector with two color strings denoting the extreme bounds of colors range to be used. |
quantity |
A string indicating the quantity to be mapped. When a |
time |
A string indicating the year of interest for the quantities to be treated, in case of temporal or spatio-temporal objects. |
style |
Method to process the color scale, see |
... |
Arguments passed to |
Value
Atmap
object.
See Also
summary.fitsae
to produce the input object and SpatialPolygonsDataFrame
to manage the shapefile.
Examples
## Not run:
library(tipsae)
# loading toy dataset
data("emilia_cs")
# fitting a model
fit_beta <- fit_sae(formula_fixed = hcr ~ x, data = emilia_cs, domains = "id",
type_disp = "var", disp_direct = "vars", domain_size = "n",
# MCMC setting to obtain a fast example. Remove next line for reliable results.
chains = 1, iter = 150, seed = 0)
# check model diagnostics
summ_beta <- summary(fit_beta)
# load shapefile of concerned areas
data("emilia_shp")
# plot the map using model diagnostics and areas shapefile
map(x = summ_beta,
spatial_df = emilia_shp,
spatial_id_domains = "NAME_DISTRICT")
## End(Not run)