Description Usage Arguments Value See Also Examples
Function map_plot
creates spatial visualizations of the estimates
obtained by small area estimation methods or direct estimation.
1 2 3 4 |
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, for ebp and direct objects: "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"; for fh objects, "FH" or "Direct";
(iii) groups of indicators (only for ebp and direct): "Quantiles", "Poverty" or
"Inequality". Defaults to "all". Note, additional custom indicators can be
defined as argument for the direct and ebp estimation (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, the mid and the highest value of the colorscale. If a numeric vector of length two is given, this scale will be used for every plot. Alternatively a list defining colors for each plot separately may be given. Please see the details section and examples for this. |
guide |
character passed to
|
return_data |
if set to |
Creates the plots demanded, and, if selected, a fortified data.frame containing the mapdata and chosen indicators.
ebp
, emdiObject
,
readShapePoly
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | ## Not run:
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@data$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@data$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)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.