map_plot {povmap} | R Documentation |
Visualizes Regional Disaggregated Estimates on a Map
Description
Function map_plot
creates spatial visualizations of the estimates
obtained by small area estimation methods or direct estimation.
Usage
map_plot(
object,
indicator = "all",
MSE = FALSE,
CV = FALSE,
map_obj = NULL,
map_dom_id = NULL,
map_tab = NULL,
color = c("white", "red4"),
scale_points = NULL,
guide = "colourbar",
return_data = FALSE
)
Arguments
object |
an object of type emdi, containing the estimates to be visualized. |
indicator |
optional character vector that selects which indicators
shall be returned: (i) all calculated indicators ("all");
(ii) each indicator name: "Mean", "Quantile_10", "Quantile_25", "Median",
"Quantile_75", "Quantile_90", "Head_Count", "Poverty_Gap", "Gini",
"Quintile_Share" or the function name/s of "custom_indicator/s";
(iii) groups of indicators: "Quantiles", "Poverty" or
"Inequality". Note, additional custom indicators can be
defined as argument for model-based approaches (see also |
MSE |
optional logical. If |
CV |
optional logical. If |
map_obj |
an |
map_dom_id |
a character string containing the name of a variable in
|
map_tab |
a |
color |
a |
scale_points |
a structure defining the lowest and the highest value of the colorscale. If a numeric vector of length two is given, this scale will be used for every plot. |
guide |
character passed to
|
return_data |
if set to |
Value
Creates the plots demanded, and, if selected, a fortified data.frame containing the mapdata and chosen indicators.
See Also
direct
, ebp
, fh
,
emdiObject
Examples
data("eusilcA_pop")
data("eusilcA_smp")
# Generate emdi object with additional indicators; here via function ebp()
emdi_model <- ebp(
fixed = eqIncome ~ gender + eqsize + cash +
self_empl + unempl_ben + age_ben + surv_ben + sick_ben +
dis_ben + rent + fam_allow + house_allow + cap_inv +
tax_adj, pop_data = eusilcA_pop,
pop_domains = "district", smp_data = eusilcA_smp,
smp_domains = "district", threshold = 11064.82,
transformation = "box.cox", L = 50, MSE = TRUE, B = 50
)
# Load shape file
load_shapeaustria()
# Create map plot for mean indicator - point and MSE estimates but no CV
map_plot(
object = emdi_model, MSE = TRUE, CV = FALSE,
map_obj = shape_austria_dis, indicator = c("Mean"),
map_dom_id = "PB"
)
# Create a suitable mapping table to use numerical identifiers of the shape
# file
# First find the right order
dom_ord <- match(shape_austria_dis$PB, emdi_model$ind$Domain)
# Create the mapping table based on the order obtained above
map_tab <- data.frame(
pop_data_id = emdi_model$ind$Domain[dom_ord],
shape_id = shape_austria_dis$BKZ
)
# Create map plot for mean indicator - point and CV estimates but no MSE
# using the numerical domain identifiers of the shape file
map_plot(
object = emdi_model, MSE = FALSE, CV = TRUE,
map_obj = shape_austria_dis, indicator = c("Mean"),
map_dom_id = "BKZ", map_tab = map_tab
)