library(tidyverse)
library(targets)
library(broom)
library(broom.mixed)
library(tidybayes)
library(glue)
library(brms)
library(scales)
library(kableExtra)
library(modelsummary)
library(here)

# Generated via random.org
set.seed(9936)

# Load data and models
withr::with_dir(here::here(), {
  source(tar_read(plot_funs))
  
  # Load big list of models
  model_df <- tar_read(model_df) %>% 
    filter(str_detect(model, "baseline") | str_detect(model, "v2csreprss")) %>% 
    filter(!str_detect(model, "_train"))
  
  # Load actual model objects
  tar_load(c(m_pts_baseline, m_pts_v2csreprss, 
             m_pts_baseline_rewb, m_pts_v2csreprss_rewb, 
             m_clphy_baseline, m_clphy_v2csreprss, 
             m_clphy_baseline_rewb, m_clphy_v2csreprss_rewb, 
             m_clpriv_baseline, m_clpriv_v2csreprss, 
             m_clpriv_baseline_rewb, m_clpriv_v2csreprss_rewb,
             m_lhr_baseline, m_lhr_v2csreprss))
  
  # Load regression tables
  tar_load(c(models_tbl_e2a, models_tbl_e2b, models_tbl_e2c, models_tbl_e2d))
  
  # Load lookup list for coefficients in regression tables
  tar_load(coef_list)
})
models <- model_df %>% 
  mutate(actual_model = model %>% map(~eval(rlang::sym(.)))) %>% 
  mutate(across(c(outcome_var, explan_var, re, family), ~fct_inorder(., ordered = TRUE)))

coefs_clean <- tribble(
  ~coef, ~coef_clean,
  "b_v2csreprss", "Civil society repression",
  "b_v2csreprss_lag1", "Civil society repression (t - 1)",
  "b_v2csreprss_within", "Civil society repression (within)",
  "b_v2csreprss_lag1_within", "Civil society repression (within; t - 1)"
) %>% 
  mutate(across(everything(), ~fct_inorder(., ordered = TRUE))) %>% 
  mutate(lagging = str_detect(coef, "lag1"))

E2a: Civil society environment and political terror

Results table

# Build nicer column names
models_for_table_e2a <- models %>% 
  filter(outcome_var == "Political terror") %>% 
  mutate(outcome_var = recode(outcome_var, "Political terror" = "PTS"),
         explan_var = recode(explan_var, "Civil society repression" = "CS repression")) %>% 
  mutate(model_name = glue("{outcome_var} (t + 1)<br>({explan_var}; {re})"))

# Make a named vector of original model names and nice names
model_names_tbl_e2a <- models_for_table_e2a %>% 
  pull(model_name) %>% 
  set_names(models_for_table_e2a$model)

# Rename the columns
names(models_tbl_e2a) <- recode(names(models_tbl_e2a), !!!model_names_tbl_e2a)

modelsummary(models_tbl_e2a,
             statistic = "[{conf.low}, {conf.high}]",
             coef_map = coef_list,
             gof_omit = "ELPD",
             escape = FALSE,
             notes = list("Posterior means; 95% credible intervals in brackets"))
PTS (t + 1)
(Baseline; RE)
PTS (t + 1)
(CS repression; RE)
PTS (t + 1)
(Baseline; REWB)
PTS (t + 1)
(CS repression; REWB)
Civil society repression -0.384
[-0.637, -0.104]
Civil society repression (t - 1) 0.079
[-0.201, 0.335]
Civil society repression (within) -0.315
[-0.594, -0.031]
Civil society repression (between) -1.246
[-4.658, 2.455]
Civil society repression (within; t - 1) 0.042
[-0.228, 0.323]
Civil society repression (between; t - 1) 0.847
[-2.868, 4.221]
PTS = 2 2.401 2.265 2.288 2.153
[2.119, 2.714] [1.973, 2.570] [2.010, 2.592] [1.854, 2.456]
PTS = 3 4.427 4.298 4.232 4.108
[4.060, 4.787] [3.912, 4.671] [3.858, 4.611] [3.725, 4.473]
PTS = 4 6.533 6.349 6.334 6.163
[6.090, 7.015] [5.870, 6.831] [5.845, 6.788] [5.687, 6.645]
PTS = 5 8.886 8.628 8.841 8.605
[8.317, 9.516] [7.989, 9.232] [8.176, 9.417] [7.967, 9.197]
Polyarchy index -2.219 -1.273
[-2.840, -1.580] [-2.210, -0.236]
Polyarchy index (within) -1.586 -1.052
[-2.518, -0.722] [-2.265, 0.146]
Polyarchy index (between) -3.314 -1.514
[-4.238, -2.456] [-3.351, 0.274]
Log GDP per capita -0.403 -0.429
[-0.543, -0.261] [-0.567, -0.283]
Log GDP per capita (within) 0.272 0.265
[-0.032, 0.595] [-0.054, 0.592]
Log GDP per capita (between) -0.434 -0.505
[-0.605, -0.275] [-0.694, -0.326]
Trade as % of GDP -0.370 -0.407
[-0.676, -0.061] [-0.737, -0.110]
Trade as % of GDP (within) -0.075 -0.120
[-0.490, 0.304] [-0.512, 0.280]
Trade as % of GDP (between) -1.221 -1.172
[-1.713, -0.703] [-1.727, -0.659]
Armed conflict 1.011 1.060 1.000 1.026
[0.706, 1.303] [0.747, 1.356] [0.712, 1.293] [0.720, 1.331]
Cutpoint 1/2 -5.152 -5.370 -6.795 -6.965
[-6.314, -3.997] [-6.590, -4.203] [-8.098, -5.405] [-8.470, -5.536]
Cutpoint 2/3 -1.197 -1.356 -2.770 -2.892
[-2.364, -0.100] [-2.536, -0.229] [-4.108, -1.544] [-4.387, -1.540]
Cutpoint 3/4 2.780 2.667 1.216 1.148
[1.698, 3.962] [1.559, 3.857] [-0.135, 2.443] [-0.211, 2.593]
Cutpoint 4/5 6.362 6.270 4.809 4.769
[5.236, 7.535] [5.037, 7.399] [3.494, 6.101] [3.343, 6.184]
Num.Obs. 3736 3612 3736 3612
R2 0.805 0.806 0.807 0.808
R2 Marg. 0.710 0.714 0.734 0.733
LOOIC 5457.4 5252.1 5414.9 5215.8
LOOIC s.e. 98.9 97.7 98.6 97.5
WAIC 5456.8 5251.4 5414.3 5215.1
Posterior means; 95% credible intervals in brackets

Coefficients

coef_plots <- models %>% 
  filter(str_detect(model, "m_pts_v2csreprss")) %>% 
  mutate(re_fancy = case_when(
    re == "RE" ~ "Random effects models",
    re == "REWB" ~ "Random effects—within/between models"
  )) %>% 
  mutate(coef_draws = map(
    actual_model, 
    ~gather_draws(model = ., `b_v2csreprss.*`, regex = TRUE))) %>% 
  select(-actual_model) %>% 
  unnest(coef_draws) %>% 
  filter(!str_detect(.variable, "between")) %>% 
  left_join(coefs_clean, by = c(".variable" = "coef"))

coef_plots %>% 
  ggplot(aes(y = fct_rev(coef_clean), x = .value, fill = re_fancy)) +
  stat_halfeye(aes(alpha = lagging), .width = c(0.8, 0.95)) +
  geom_vline(xintercept = 0) +
  guides(fill = FALSE, alpha = FALSE) +
  scale_alpha_manual(values = c(1, 0.4)) +
  labs(x = "Coefficient", y = NULL) +
  facet_wrap(vars(re_fancy), ncol = 1, scales = "free_y") +
  theme_ngo()

Marginal effects

mfx <- models %>% 
  filter(str_detect(model, "m_pts_v2csreprss")) %>% 
  mutate(plot_vars = case_when(
    re == "RE" ~ "v2csreprss",
    re == "REWB" ~ "v2csreprss_within"
  )) %>% 
  mutate(fx = map2(actual_model, plot_vars, 
                   ~conditional_effects(.x, effects = .y,
                                        categorical = TRUE)[[1]])) %>% 
  select(-actual_model) %>% 
  unnest(fx)

mfx %>% 
  filter(model == "m_pts_v2csreprss") %>% 
  ggplot(aes(x = effect1__, y = estimate__, color = effect2__, fill = effect2__)) +
  geom_ribbon(aes(ymin = lower__, ymax = upper__), alpha = 0.4, color = NA) +
  geom_line(size = 1) +
  labs(x = "Civil society repression\n(higher values = less repression)",
       y = "Predicted probability of category",
       color = "Political terror scale", fill = "Political terror scale") +
  theme_ngo()

mfx %>% 
  filter(model == "m_pts_v2csreprss_rewb") %>% 
  ggplot(aes(x = effect1__, y = estimate__, color = effect2__, fill = effect2__)) +
  geom_ribbon(aes(ymin = lower__, ymax = upper__), alpha = 0.4, color = NA) +
  geom_line(size = 1) +
  labs(x = "Difference from average level of civil society repression\n(higher values = less repression)",
       y = "Predicted probability of category",
       color = "Political terror scale", fill = "Political terror scale") +
  theme_ngo()

 

E2b: Civil society environment and physical violence

Results table

# Build nicer column names
models_for_table_e2b <- models %>% 
  filter(outcome_var == "Physical violence") %>% 
  mutate(explan_var = recode(explan_var, "Civil society repression" = "CS repression")) %>% 
  mutate(model_name = glue("{outcome_var} (t + 1)<br>({explan_var}; {re})"))

# Make a named vector of original model names and nice names
model_names_tbl_e2b <- models_for_table_e2b %>% 
  pull(model_name) %>% 
  set_names(models_for_table_e2b$model)

# Rename the columns
names(models_tbl_e2b) <- recode(names(models_tbl_e2b), !!!model_names_tbl_e2b)

modelsummary(models_tbl_e2b,
             statistic = "[{conf.low}, {conf.high}]",
             coef_map = coef_list,
             gof_omit = "ELPD",
             escape = FALSE,
             notes = list("Posterior means; 95% credible intervals in brackets"))
Physical violence (t + 1)
(Baseline; RE)
Physical violence (t + 1)
(CS repression; RE)
Physical violence (t + 1)
(Baseline; REWB)
Physical violence (t + 1)
(CS repression; REWB)
Civil society repression 0.026
[0.020, 0.031]
Civil society repression (t - 1) -0.022
[-0.028, -0.017]
Civil society repression (within) 0.019
[0.012, 0.025]
Civil society repression (between) 0.086
[0.030, 0.141]
Civil society repression (within; t - 1) -0.024
[-0.031, -0.019]
Civil society repression (between; t - 1) -0.080
[-0.140, -0.029]
Physical violence index (t) 0.967 0.963 0.967 0.965
[0.954, 0.979] [0.950, 0.974] [0.955, 0.977] [0.954, 0.975]
Polyarchy index 0.011 0.001
[0.001, 0.021] [-0.013, 0.015]
Polyarchy index (within) -0.089 -0.056
[-0.109, -0.068] [-0.081, -0.029]
Polyarchy index (between) 0.029 0.000
[0.018, 0.040] [-0.016, 0.016]
Log GDP per capita 0.001 0.002
[0.000, 0.003] [0.000, 0.003]
Log GDP per capita (within) -0.003 -0.002
[-0.010, 0.003] [-0.008, 0.005]
Log GDP per capita (between) -0.001 0.001
[-0.002, 0.001] [-0.001, 0.002]
Trade as % of GDP -0.003 -0.002
[-0.007, 0.001] [-0.006, 0.002]
Trade as % of GDP (within) -0.004 -0.003
[-0.012, 0.004] [-0.011, 0.005]
Trade as % of GDP (between) 0.001 0.000
[-0.003, 0.005] [-0.004, 0.004]
Armed conflict -0.001 -0.001 -0.001 -0.001
[-0.005, 0.004] [-0.006, 0.004] [-0.005, 0.003] [-0.005, 0.003]
Intercept 0.015 0.014 0.015 0.016
[0.004, 0.024] [0.004, 0.023] [0.006, 0.025] [0.006, 0.026]
Num.Obs. 3769 3629 3769 3629
R2 0.971 0.971 0.972 0.972
R2 Marg. 0.970 0.971 0.972 0.972
LOOIC -12083.2 -11767.1 -12224.9 -11896.8
LOOIC s.e. 424.4 422.9 412.9 411.8
WAIC -12084.4 -11767.9 -12225.1 -11901.2
Posterior means; 95% credible intervals in brackets

Coefficients

coef_plots <- models %>% 
  filter(str_detect(model, "m_clphy_v2csreprss")) %>% 
  mutate(re_fancy = case_when(
    re == "RE" ~ "Random effects models",
    re == "REWB" ~ "Random effects—within/between models"
  )) %>% 
  mutate(coef_draws = map(
    actual_model, 
    ~gather_draws(model = ., `b_v2csreprss.*`, regex = TRUE))) %>% 
  select(-actual_model) %>% 
  unnest(coef_draws) %>% 
  filter(!str_detect(.variable, "between")) %>% 
  left_join(coefs_clean, by = c(".variable" = "coef"))

coef_plots %>% 
  ggplot(aes(y = fct_rev(coef_clean), x = .value, fill = re_fancy)) +
  stat_halfeye(aes(alpha = lagging), .width = c(0.8, 0.95)) +
  geom_vline(xintercept = 0) +
  guides(fill = FALSE, alpha = FALSE) +
  scale_alpha_manual(values = c(1, 0.4)) +
  labs(x = "Coefficient", y = NULL) +
  facet_wrap(vars(re_fancy), ncol = 1, scales = "free_y") +
  theme_ngo()

Marginal effects

mfx <- models %>% 
  filter(str_detect(model, "m_clphy_v2csreprss")) %>% 
  mutate(plot_vars = case_when(
    re == "RE" ~ "v2csreprss",
    re == "REWB" ~ "v2csreprss_within"
  )) %>% 
  mutate(fx = map2(actual_model, plot_vars, 
                   ~conditional_effects(.x, effects = .y)[[1]])) %>% 
  select(-actual_model) %>% 
  unnest(fx)

mfx %>% 
  filter(model == "m_clphy_v2csreprss") %>% 
  ggplot(aes(x = effect1__, y = estimate__)) +
  geom_ribbon(aes(ymin = lower__, ymax = upper__), alpha = 0.4, 
              fill = "#FF4136", color = NA) +
  geom_line(size = 1, color = "#FF4136") +
  labs(x = "Civil society repression\n(higher values = less repression)",
       y = "Predicted physical violence index\n(higher values = less violence)") +
  theme_ngo()

mfx %>% 
  filter(model == "m_clphy_v2csreprss_rewb") %>% 
  ggplot(aes(x = effect1__, y = estimate__)) +
  geom_ribbon(aes(ymin = lower__, ymax = upper__), alpha = 0.4, 
              fill = "#FF4136", color = NA) +
  geom_line(size = 1, color = "#FF4136") +
  labs(x = "Difference from average level of civil society repression\n(higher values = less repression)",
       y = "Predicted physical violence index\n(higher values = less violence)") +
  theme_ngo()

 

E2c: Civil society environment and civil liberties

# Build nicer column names
models_for_table_e2c <- models %>% 
  filter(outcome_var == "Private civil liberties") %>% 
  mutate(explan_var = recode(explan_var, "Civil society repression" = "CS repression")) %>% 
  mutate(model_name = glue("{outcome_var} (t + 1)<br>({explan_var}; {re})"))

# Make a named vector of original model names and nice names
model_names_tbl_e2c <- models_for_table_e2c %>% 
  pull(model_name) %>% 
  set_names(models_for_table_e2c$model)

# Rename the columns
names(models_tbl_e2c) <- recode(names(models_tbl_e2c), !!!model_names_tbl_e2c)

modelsummary(models_tbl_e2c,
             statistic = "[{conf.low}, {conf.high}]",
             coef_map = coef_list,
             gof_omit = "ELPD",
             escape = FALSE,
             notes = list("Posterior means; 95% credible intervals in brackets"))
Private civil liberties (t + 1)
(Baseline; RE)
Private civil liberties (t + 1)
(CS repression; RE)
Private civil liberties (t + 1)
(Baseline; REWB)
Private civil liberties (t + 1)
(CS repression; REWB)
Civil society repression 0.021
[0.017, 0.025]
Civil society repression (t - 1) -0.019
[-0.023, -0.015]
Civil society repression (within) 0.017
[0.013, 0.021]
Civil society repression (between) 0.061
[0.013, 0.108]
Civil society repression (within; t - 1) -0.019
[-0.023, -0.015]
Civil society repression (between; t - 1) -0.055
[-0.103, -0.007]
Private civil liberties index (t) 0.959 0.967 0.931 0.945
[0.939, 0.975] [0.956, 0.978] [0.909, 0.951] [0.926, 0.962]
Polyarchy index 0.019 0.007
[0.008, 0.030] [-0.005, 0.018]
Polyarchy index (within) -0.043 -0.041
[-0.060, -0.025] [-0.059, -0.022]
Polyarchy index (between) 0.066 0.023
[0.046, 0.088] [0.008, 0.042]
Log GDP per capita -0.001 -0.001
[-0.003, 0.000] [-0.002, 0.000]
Log GDP per capita (within) -0.007 -0.006
[-0.011, -0.002] [-0.011, -0.002]
Log GDP per capita (between) -0.004 -0.002
[-0.005, -0.002] [-0.003, -0.001]
Trade as % of GDP 0.000 0.001
[-0.004, 0.003] [-0.002, 0.004]
Trade as % of GDP (within) 0.001 0.003
[-0.005, 0.007] [-0.003, 0.009]
Trade as % of GDP (between) 0.006 0.004
[0.001, 0.011] [0.000, 0.008]
Armed conflict 0.000 0.001 -0.002 0.000
[-0.004, 0.003] [-0.002, 0.004] [-0.006, 0.002] [-0.003, 0.003]
Intercept 0.033 0.026 0.044 0.038
[0.022, 0.045] [0.018, 0.036] [0.031, 0.057] [0.026, 0.051]
Num.Obs. 3769 3629 3769 3629
R2 0.981 0.982 0.982 0.983
R2 Marg. 0.980 0.982 0.981 0.983
LOOIC -14363.3 -14101.5 -14571.4 -14278.2
LOOIC s.e. 508.1 488.9 482.1 472.6
WAIC -14357.8 -14103.5 -14571.7 -14273.4
Posterior means; 95% credible intervals in brackets

Coefficients

coef_plots <- models %>% 
  filter(str_detect(model, "m_clpriv_v2csreprss")) %>% 
  mutate(re_fancy = case_when(
    re == "RE" ~ "Random effects models",
    re == "REWB" ~ "Random effects—within/between models"
  )) %>% 
  mutate(coef_draws = map(
    actual_model, 
    ~gather_draws(model = ., `b_v2csreprss.*`, regex = TRUE))) %>% 
  select(-actual_model) %>% 
  unnest(coef_draws) %>% 
  filter(!str_detect(.variable, "between")) %>% 
  left_join(coefs_clean, by = c(".variable" = "coef"))

coef_plots %>% 
  ggplot(aes(y = fct_rev(coef_clean), x = .value, fill = re_fancy)) +
  stat_halfeye(aes(alpha = lagging), .width = c(0.8, 0.95)) +
  geom_vline(xintercept = 0) +
  guides(fill = FALSE, alpha = FALSE) +
  scale_alpha_manual(values = c(1, 0.4)) +
  labs(x = "Coefficient", y = NULL) +
  facet_wrap(vars(re_fancy), ncol = 1, scales = "free_y") +
  theme_ngo()

Marginal effects

mfx <- models %>% 
  filter(str_detect(model, "m_clpriv_v2csreprss")) %>% 
  mutate(plot_vars = case_when(
    re == "RE" ~ "v2csreprss",
    re == "REWB" ~ "v2csreprss_within"
  )) %>% 
  mutate(fx = map2(actual_model, plot_vars, 
                   ~conditional_effects(.x, effects = .y)[[1]])) %>% 
  select(-actual_model) %>% 
  unnest(fx)

mfx %>% 
  filter(model == "m_clpriv_v2csreprss") %>% 
  ggplot(aes(x = effect1__, y = estimate__)) +
  geom_ribbon(aes(ymin = lower__, ymax = upper__), alpha = 0.4, 
              fill = "#FF4136", color = NA) +
  geom_line(size = 1, color = "#FF4136") +
  labs(x = "Civil society repression\n(higher values = less repression)",
       y = "Predicted civil liberties index\n(higher values = less violence)") +
  theme_ngo()

mfx %>% 
  filter(model == "m_clpriv_v2csreprss_rewb") %>% 
  ggplot(aes(x = effect1__, y = estimate__)) +
  geom_ribbon(aes(ymin = lower__, ymax = upper__), alpha = 0.4, 
              fill = "#FF4136", color = NA) +
  geom_line(size = 1, color = "#FF4136") +
  labs(x = "Difference from average level of civil society repression\n(higher values = less repression)",
       y = "Predicted civil liberties index\n(higher values = less violence)") +
  theme_ngo()

 

E2d: Civil society environment and latent physical integrity rights

# Build nicer column names
models_for_table_e2d <- models %>% 
  filter(outcome_var == "Latent human rights") %>% 
  mutate(explan_var = recode(explan_var, "Civil society repression" = "CS repression")) %>% 
  mutate(model_name = glue("{outcome_var} (t + 1)<br>({explan_var}; {re})"))

# Make a named vector of original model names and nice names
model_names_tbl_e2d <- models_for_table_e2d %>% 
  pull(model_name) %>% 
  set_names(models_for_table_e2d$model)

# Rename the columns
names(models_tbl_e2d) <- recode(names(models_tbl_e2d), !!!model_names_tbl_e2d)

modelsummary(models_tbl_e2d,
             statistic = "[{conf.low}, {conf.high}]",
             coef_map = coef_list,
             gof_omit = "ELPD",
             escape = FALSE,
             notes = list("Posterior means; 95% credible intervals in brackets"))
Latent human rights (t + 1)
(Baseline; RE)
Latent human rights (t + 1)
(CS repression; RE)
Civil society repression 0.053
[0.024, 0.082]
Civil society repression (t - 1) -0.037
[-0.066, -0.008]
Latent human rights (t) 0.965 0.963
[0.955, 0.976] [0.951, 0.974]
Polyarchy index 0.091 0.017
[0.048, 0.128] [-0.057, 0.085]
Log GDP per capita 0.007 0.009
[-0.001, 0.014] [0.001, 0.017]
Trade as % of GDP 0.023 0.022
[0.003, 0.043] [0.001, 0.041]
Armed conflict -0.007 -0.002
[-0.032, 0.019] [-0.028, 0.024]
Intercept -0.077 -0.073
[-0.136, -0.024] [-0.137, -0.015]
Num.Obs. 3769 3629
R2 0.968 0.968
R2 Marg. 0.968 0.968
LOOIC 117.0 60.6
LOOIC s.e. 352.2 350.3
WAIC 116.4 59.7
Posterior means; 95% credible intervals in brackets

Coefficients

coef_plots <- models %>% 
  filter(str_detect(model, "m_lhr_v2csreprss")) %>% 
  mutate(re_fancy = case_when(
    re == "RE" ~ "Random effects models",
    re == "REWB" ~ "Random effects—within/between models"
  )) %>% 
  mutate(coef_draws = map(
    actual_model, 
    ~gather_draws(model = ., `b_v2csreprss.*`, regex = TRUE))) %>% 
  select(-actual_model) %>% 
  unnest(coef_draws) %>% 
  filter(!str_detect(.variable, "between")) %>% 
  left_join(coefs_clean, by = c(".variable" = "coef"))

coef_plots %>% 
  ggplot(aes(y = fct_rev(coef_clean), x = .value, fill = re_fancy)) +
  stat_halfeye(aes(alpha = lagging), .width = c(0.8, 0.95)) +
  geom_vline(xintercept = 0) +
  guides(fill = FALSE, alpha = FALSE) +
  scale_alpha_manual(values = c(1, 0.4)) +
  labs(x = "Coefficient", y = NULL) +
  facet_wrap(vars(re_fancy), ncol = 1, scales = "free_y") +
  theme_ngo()

Marginal effects

mfx <- models %>% 
  filter(str_detect(model, "m_lhr_v2csreprss")) %>% 
  mutate(fx = map2(actual_model, "v2csreprss",
                   ~conditional_effects(.x, effects = .y)[[1]])) %>% 
  select(-actual_model) %>% 
  unnest(fx)

mfx %>% 
  filter(model == "m_lhr_v2csreprss") %>% 
  ggplot(aes(x = effect1__, y = estimate__)) +
  geom_ribbon(aes(ymin = lower__, ymax = upper__), alpha = 0.4, 
              fill = "#FF4136", color = NA) +
  geom_line(size = 1, color = "#FF4136") +
  labs(x = "Civil society repression\n(higher values = less repression)",
       y = "Predicted latent human rights\n(higher values = less violence)") +
  theme_ngo()

LS0tCnRpdGxlOiAiRX4yfjogQ2l2aWwgc29jaWV0eSBlbnZpcm9ubWVudCBwcmVkaWN0cyBkZXRlcmlvcmF0aW5nIGh1bWFuIHJpZ2h0cyIKYXV0aG9yOiAiU3VwYXJuYSBDaGF1ZGhyeSBhbmQgQW5kcmV3IEhlaXNzIgpkYXRlOiAiTGFzdCBydW46IGByIGZvcm1hdChTeXMudGltZSgpLCAnJUYnKWAiCm91dHB1dDogCiAgaHRtbF9kb2N1bWVudDoKICAgIGNvZGVfZm9sZGluZzogaGlkZQplZGl0b3Jfb3B0aW9uczogCiAgY2h1bmtfb3V0cHV0X3R5cGU6IGNvbnNvbGUKLS0tCgpgYGB7ciBzZXR1cCwgaW5jbHVkZT1GQUxTRX0KbGlicmFyeShrbml0cikKbGlicmFyeShrYWJsZUV4dHJhKQprbml0X3ByaW50LmRhdGEuZnJhbWUgPC0gZnVuY3Rpb24oeCwgLi4uKSB7CiAgcmVzIDwtIHBhc3RlKGMoJycsICcnLCBrYWJsZV9zdHlsaW5nKGthYmxlKHgsIGJvb2t0YWJzID0gVFJVRSkpKSwgY29sbGFwc2UgPSAnXG4nKQogIGFzaXNfb3V0cHV0KHJlcykKfQoKcmVnaXN0ZXJTM21ldGhvZCgia25pdF9wcmludCIsICJkYXRhLmZyYW1lIiwga25pdF9wcmludC5kYXRhLmZyYW1lKQpyZWdpc3RlclMzbWV0aG9kKCJrbml0X3ByaW50IiwgImdyb3VwZWRfZGYiLCBrbml0X3ByaW50LmRhdGEuZnJhbWUpCgprbml0cjo6b3B0c19jaHVuayRzZXQoZmlnLnJldGluYSA9IDMsCiAgICAgICAgICAgICAgICAgICAgICB0aWR5Lm9wdHMgPSBsaXN0KHdpZHRoLmN1dG9mZiA9IDEyMCksICAjIEZvciBjb2RlCiAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zKHdpZHRoID0gOTApLCAgIyBGb3Igb3V0cHV0CiAgICAgICAgICAgICA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