if (FALSE) {
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")
}
Run the code above in your browser using DataLab