# NOT RUN {
# Loading data - population and sample data
data("eusilcA_pop")
data("eusilcA_smp")
# Generation of two emdi objects
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 = function(y){0.6 * median(y)}, L = 50, MSE = TRUE,
na.rm = TRUE, cpus = 1)
emdi_direct <- direct(y = "eqIncome", smp_data = eusilcA_smp,
smp_domains = "district", weights = "weight", threshold = 11161.44,
var = TRUE, boot_type = "naive", B = 50, seed = 123, na.rm = TRUE)
# Example 1: Receive first overview
compare_plot(direct = emdi_direct, model = emdi_model)
# Example 2: Change plot theme
library(ggplot2)
compare_plot(emdi_direct, emdi_model, indicator = "Median",
gg_theme = theme(axis.line = element_line(size = 3, colour = "grey80"),
plot.background = element_rect(fill = "lightblue3"),
legend.position = "none"))
# }
Run the code above in your browser using DataLab