library(tidyverse)
library(canaryNGOs)
library(brms)
library(broom)
library(tidybayes)
library(sf)
library(scico)
library(scales)
library(patchwork)
library(ggtext)
library(here)

CHAINS <- 4
ITER <- 2000
WARMUP <- 1000
BAYES_SEED <- 1234
options(mc.cores = parallel::detectCores())  # Use all cores

canary <- read_rds(here("data", "derived_data", "canary_clean.rds"))

# https://www.naturalearthdata.com/downloads/110m-cultural-vectors/
country_borders <- read_sf(here("data", "raw_data", "Natural Earth", 
                                "ne_110m_admin_0_countries", 
                                "ne_110m_admin_0_countries.shp"))

Civil society restrictions over time

things_to_map <- canary %>% 
  filter(year %in% c(2000, 2014)) %>% 
  select(country, year, iso3, barriers_total, PTS_factor, v2csreprss) %>% 
  pivot_wider(names_from = year, values_from = c(barriers_total, PTS_factor, v2csreprss)) %>% 
  mutate(new_laws = barriers_total_2014 - barriers_total_2000,
         new_laws = ifelse(new_laws <= 0, 0, new_laws),
         new_laws = ceiling(new_laws)) %>% 
  mutate(diff_csrepress = v2csreprss_2014 - v2csreprss_2000,
         diff_csrepress_trunc = case_when(
           diff_csrepress >= 2 ~ 2,
           diff_csrepress <= -2 ~ -2,
           TRUE ~ diff_csrepress
         )) %>% 
  mutate(pct_change_csrepress = diff_csrepress / v2csreprss_2000,
         pct_change_csrepress_trunc = case_when(
           pct_change_csrepress >= 5 ~ 5,
           pct_change_csrepress <= -5 ~ -5,
           TRUE ~ pct_change_csrepress
         ))

map_data <- country_borders %>% 
  left_join(things_to_map, by = c("ADM0_A3_IS" = "iso3")) %>% 
  filter(ISO_A3 != "ATA")

Legislation

map_ngo_laws <- ggplot() +
  geom_sf(data = map_data, aes(fill = factor(new_laws)),
          color = "black", size = 0.1) +
  coord_sf(crs = 54030, datum = NA, expand = FALSE) + 
  scale_fill_manual(values = seq_gradient_pal("#FFFFFF", "#BF0404")(seq(0, 1, length.out = 7)), 
                    na.value = "grey80", breaks = 0:6) +
  # scale_fill_manual(values = scico(7, palette = "devon", direction = -1), 
  #                   na.value = "grey80", breaks = 0:6) +
  guides(fill = guide_legend(nrow = 1, label.position = "bottom",
                             keywidth = unit(1, units = "lines"),
                             keyheight = unit(0.6, units = "lines"))) +
  labs(fill = "Restrictive NGO laws passed between 2000 and 2014") +
  theme_ngo() +
  theme(panel.border = element_blank(),
        legend.box.margin = margin(t = 5),
        legend.spacing.x = unit(0, "pt"),
        legend.title = element_textbox_simple(halign = 1,
                                              lineheight = 1.3,
                                              minwidth = unit(2, "lines"),
                                              maxwidth = unit(10, "lines"),
                                              padding = margin(r = 10)))
map_ngo_laws

Civil society repression

map_cs_repression <- ggplot() +
  geom_sf(data = map_data, aes(fill = diff_csrepress_trunc),
          color = "black", size = 0.1) +
  coord_sf(crs = 54030, datum = NA, expand = FALSE) + 
  scale_fill_scico(palette = "vik", direction = -1,
                   limits = c(-1, 1) * max(abs(map_data$diff_csrepress_trunc), na.rm = TRUE),
                   breaks = seq(-4, 4, 1), na.value = "grey80") +
  guides(fill = guide_colorbar(reverse = TRUE, ticks = FALSE,
                               barwidth = unit(7, units = "lines"),
                               barheight = unit(0.5, units = "lines"))) +
  labs(fill = "Change in V-Dem civil society repression between 2000 and 2014") +
  theme_ngo() +
  theme(panel.border = element_blank(),
        legend.box.margin = margin(t = 5),
        legend.title = element_textbox_simple(halign = 1,
                                              lineheight = 1.3,
                                              minwidth = unit(2, "lines"),
                                              maxwidth = unit(12, "lines"),
                                              padding = margin(r = 10)))
map_cs_repression

PTS and civil society restrictions

V-Dem civil society repression and the PTS

diff_cs_pts <- brm(
  bf(v2csreprss ~ 0 + PTS_factor, sigma ~ 0 + PTS_factor),
  family = student,
  data = filter(canary, year == 2010) %>% select(v2csreprss, PTS_factor),
  prior = c(
    # Set group mean prior
    set_prior("normal(0, 1)", class = "b", lb = -4, ub = 4),
    # Set group variance priors. We keep the less informative cauchy(0, 1).
    set_prior("cauchy(0, 1)", class = "b", dpar = "sigma"),
    set_prior("exponential(1.0/29)", class = "nu")
  ),
  chains = CHAINS, iter = ITER, warmup = WARMUP, seed = BAYES_SEED,
  file = here("analysis", "cache", "diff_cs_pts")
)
diff_cs_pts_summary <- diff_cs_pts %>%
  gather_draws(`b_PTS.*`, regex = TRUE) %>% 
  median_hdci(.width = 0.95) %>% 
  to_broom_names()

diff_cs_pts_draws <- diff_cs_pts %>% 
  gather_draws(`b_PTS.*`, regex = TRUE) %>% 
  ungroup() %>% 
  mutate(.variable = str_replace(.variable, "b_PTS_factorLevel", "Level ")) %>% 
  mutate(pts_level = fct_rev(.variable))

diff_cs_pts_posterior <- canary %>% 
  filter(year == 2010) %>% 
  modelr::data_grid(PTS_factor) %>% 
  add_fitted_draws(diff_cs_pts, seed = BAYES_SEED)
ggplot(diff_cs_pts_draws, aes(y = pts_level, x = .value, fill = pts_level)) + 
  geom_halfeyeh() +
  scale_x_reverse() +
  scale_fill_viridis_d(option = "inferno", begin = 0.2, end = 0.9, guide = FALSE) +
  labs(x = "Civil society repression", y = "Political Terror Scale (PTS)") +
  theme_ngo()

ggplot(diff_cs_pts_posterior, aes(x = .value, y = fct_rev(PTS_factor), color = fct_rev(PTS_factor))) +
  stat_dotsh(quantiles = 100, shape = 19) +
  stat_pointintervalh(aes(point_colour = after_scale(colorspace::darken(color, 0.65)),
                          interval_colour = after_scale(colorspace::darken(color, 0.35)))) +
  scale_x_reverse() +
  scale_color_viridis_d(option = "inferno", begin = 0.2, end = 0.9, guide = FALSE) +
  labs(x = "Civil society repression", y = "Political Terror Scale (PTS)",
       caption = "Each • represents an equally likely outcome from the posterior distribution") +
  theme_ngo()

# ggsave("~/Desktop/plot1.pdf", device = cairo_pdf, width = 5, height = 3, units = "in")
# ggsave("~/Desktop/plot1.png", type = "cairo", dpi = 300, width = 6, height = 3.6, units = "in")

Chaudhry NGO regulations and V-Dem’s v2csreprss

canary_barriers <- canary %>% 
  pivot_longer(cols = c(advocacy, entry, funding, barriers_total), 
               names_to = "barrier", values_to = "count") %>% 
  mutate(barrier = recode(barrier, advocacy = "Barriers to advocacy",
                          entry = "Barriers to entry", 
                          funding = "Barriers to funding",
                          barriers_total = "Total NGO barriers"))

ggplot(canary_barriers, aes(x = count, y = v2csreprss)) +
  geom_point(alpha = 0.2) +
  geom_smooth(method = "lm") +
  labs(x = "Number of restrictive NGO laws", 
       y = "V-Dem's civil society repression score") +
  facet_wrap(vars(barrier), scales = "free_x") +
  theme_ngo()

Chaudhry NGO regulations and the PTS

diff_ngo_pts <- brm(
  bf(barriers_total ~ 0 + PTS_factor, sigma ~ 0 + PTS_factor),
  family = student,
  data = select(canary, barriers_total, PTS_factor),
  prior = c(
    # Set group mean prior
    set_prior("normal(0, 1)", class = "b", lb = -4, ub = 4),
    # Set group variance priors. We keep the less informative cauchy(0, 1).
    set_prior("cauchy(0, 1)", class = "b", dpar = "sigma"),
    set_prior("exponential(1.0/29)", class = "nu")
  ),
  chains = CHAINS, iter = ITER, warmup = WARMUP, seed = BAYES_SEED,
  file = here("analysis", "cache", "diff_ngo_pts")
)
## Warning: Rows containing NAs were excluded from the model.
diff_ngo_pts_summary <- diff_ngo_pts %>%
  gather_draws(`b_PTS.*`, regex = TRUE) %>% 
  median_hdci(.width = 0.95) %>% 
  to_broom_names()

diff_ngo_pts_draws <- diff_ngo_pts %>% 
  gather_draws(`b_PTS.*`, regex = TRUE) %>% 
  ungroup() %>% 
  mutate(.variable = str_replace(.variable, "b_PTS_factorLevel", "Level ")) %>% 
  mutate(pts_level = fct_rev(.variable))

diff_ngo_pts_posterior <- canary %>% 
  filter(year == 2010) %>% 
  modelr::data_grid(PTS_factor) %>% 
  add_fitted_draws(diff_ngo_pts, seed = BAYES_SEED)
ggplot(diff_ngo_pts_draws, aes(y = pts_level, x = .value, fill = pts_level)) + 
  geom_halfeyeh() +
  scale_fill_viridis_d(option = "inferno", begin = 0.2, end = 0.9, guide = FALSE) +
  labs(x = "Number of restrictive NGO laws", y = "Political Terror Scale (PTS)") +
  theme_ngo()

ggplot(diff_ngo_pts_posterior, aes(x = .value, y = fct_rev(PTS_factor), color = fct_rev(PTS_factor))) +
  stat_dotsh(quantiles = 100, shape = 19) +
  stat_pointintervalh(aes(point_colour = after_scale(colorspace::darken(color, 0.65)),
                          interval_colour = after_scale(colorspace::darken(color, 0.35)))) +
  scale_color_viridis_d(option = "inferno", begin = 0.2, end = 0.9, guide = FALSE) +
  labs(x = "Number of restrictive NGO laws", y = "Political Terror Scale (PTS)",
       caption = "Each • represents an equally likely outcome from the posterior distribution") +
  theme_ngo()

Conflict and civil society restrictions

diff_cs_conflict <- brm(
  bf(v2csreprss ~ 0 + armed_conflict, sigma ~ 0 + armed_conflict),
  family = student,
  data = select(canary, v2csreprss, armed_conflict),
  prior = c(
    # Set group mean prior
    set_prior("normal(0, 1)", class = "b", lb = -4, ub = 4),
    # Set group variance priors. We keep the less informative cauchy(0, 1).
    set_prior("cauchy(0, 1)", class = "b", dpar = "sigma"),
    set_prior("exponential(1.0/29)", class = "nu")
  ),
  chains = CHAINS, iter = ITER, warmup = WARMUP, seed = BAYES_SEED,
  file = here("analysis", "cache", "diff_cs_conflict")
)
diff_cs_conflict_summary <- diff_cs_conflict %>%
  gather_draws(`b_armed.*`, regex = TRUE) %>% 
  median_hdci(.width = 0.95) %>% 
  to_broom_names()

diff_cs_conflict_draws <- diff_cs_conflict %>% 
  gather_draws(`b_armed.*`, regex = TRUE) %>% 
  ungroup() %>% 
  mutate(.variable = recode(.variable, `b_armed_conflictFALSE` = "No armed conflict",
                            `b_armed_conflictTRUE` = "Armed conflict"))

diff_cs_conflict_posterior <- canary %>% 
  filter(year == 2010) %>% 
  modelr::data_grid(armed_conflict) %>% 
  add_fitted_draws(diff_cs_conflict, seed = BAYES_SEED) %>% 
  ungroup() %>% 
  mutate(armed_conflict = factor(armed_conflict, labels = c("No armed conflict", "Armed conflict")))
ggplot(diff_cs_conflict_draws, aes(y = .variable, x = .value, fill = .variable)) + 
  geom_halfeyeh() +
  scale_x_reverse() +
  scale_fill_viridis_d(option = "inferno", begin = 0.2, end = 0.9, guide = FALSE) +
  labs(x = "Civil society repression", y = "Armed conflict") +
  theme_ngo()

ggplot(diff_cs_conflict_posterior, aes(x = .value, y = fct_rev(armed_conflict), color = fct_rev(armed_conflict))) +
  stat_dotsh(quantiles = 100, shape = 19) +
  stat_pointintervalh(aes(point_colour = after_scale(colorspace::darken(color, 0.65)),
                          interval_colour = after_scale(colorspace::darken(color, 0.35)))) +
  scale_x_reverse() +
  scale_color_viridis_d(option = "inferno", begin = 0.2, end = 0.9, guide = FALSE) +
  labs(x = "Civil society repression", y = "Armed conflict",
       caption = "Each • represents an equally likely outcome from the posterior distribution") +
  theme_ngo()

# ggsave("~/Desktop/plot1.pdf", device = cairo_pdf, width = 5, height = 3, units = "in")
# ggsave("~/Desktop/plot1.png", type = "cairo", dpi = 300, width = 6, height = 3.6, units = "in")

Civil society restrictions and other kinds of repression

library(GGally)
repression_only <- canary %>% 
  filter(year == 2014) %>% 
  select(barriers_total, PTS, gh_alljourn, 
         v2clacfree, v2csrlgrep, v2mecenefm, v2mecenefi, v2meharjrn, v2meslfcen,
         v2x_clphy, v2x_clpol, v2x_clpriv, v2x_freexp, v2csreprss)

ggscatmat(repression_only, alpha = 0.4) + 
  theme_ngo(base_size = 6)

LS0tCnRpdGxlOiAiRGVzY3JpcHRpdmUgYW5hbHlzaXMiCmF1dGhvcjogIlN1cGFybmEgQ2hhdWRocnkgYW5kIEFuZHJldyBIZWlzcyIKZGF0ZTogIkxhc3QgcnVuOiBgciBmb3JtYXQoU3lzLnRpbWUoKSwgJyVGJylgIgpvdXRwdXQ6IAogIGh0bWxfZG9jdW1lbnQ6CiAgICBjb2RlX2ZvbGRpbmc6IGhpZGUKcGFyYW1zOgogIGZpZ193aWR0aDogNgogIGZpZ19oZWlnaHQ6IDMuNgogIGZpZ19oZWlnaHRfdGFsbGVyOiA1Ci0tLQoKYGBge3Igc2V0dXAsIHdhcm5pbmc9RkFMU0UsIG1lc3NhZ2U9RkFMU0V9CmxpYnJhcnkodGlkeXZlcnNlKQpsaWJyYXJ5KGNhbmFyeU5HT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ICJSZXN0cmljdGl2ZSBOR08gbGF3cyBwYXNzZWQgYmV0d2VlbiAyMDAwIGFuZCAyMDE0IikgKwogIHRoZW1lX25nbygpICsKICB0aGVtZShwYW5lbC5ib3JkZXIgPSBlbGVtZW50X2JsYW5rKCksCiAgICAgICAgbGVnZW5kLmJveC5tYXJnaW4gPSBtYXJnaW4odCA9IDUpLAogICAgICAgIGxlZ2VuZC5zcGFjaW5nLnggPSB1bml0KDAsICJwdCIpLAogICAgICAgIGxlZ2VuZC50aXRsZSA9IGVsZW1lbnRfdGV4dGJveF9zaW1wbGUoaGFsaWduID0gMSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVoZWlnaHQgPSAxLjMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaW53aWR0aCA9IHVuaXQoMiwgImxpbmVzIiksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXh3aWR0aCA9IHVuaXQoMTAsICJsaW5lcyIpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZyA9IG1hcmdpbihyID0gMTApKSkKbWFwX25nb19sYXdzCmBgYAoKIyMgQ2l2aWwgc29jaWV0eSByZXByZXNzaW9uCgpgYGB7ciBtYXAtY3MtcmVwcmVzc2lvbiwgZmlnLndpZHRoPXBhcmFtcyRmaWdfd2lkdGgsIGZpZy5oZWlnaHQ9cGFyYW1zJGZpZ19oZWlnaHRfdGFsbGVyfQptYXBfY3NfcmVwcmVzc2lvbiA8LSBnZ3Bsb3QoKSArCiAgZ2VvbV9zZihkYXRhID0gbWFwX2RhdGEsIGFlcyhmaWxsID0gZGlmZl9jc3JlcHJlc3NfdHJ1bmMpLAogICAgICAgICAgY29sb3IgPSAiYmxhY2siLCBzaXplID0gMC4xKSArCiAgY29vcmRfc2YoY3JzID0gNTQwMzAsIGRhdHVtID0gTkEsIGV4cGFuZCA9IEZBTFNFKSArIAogIHNjYWxlX2ZpbGxfc2NpY28ocGFsZXR0ZSA9ICJ2aWsiLCBkaXJlY3Rpb24gPSAtMSwKICAgICAgICAgICAgICAgICAgIGxpbWl0cyA9IGMoLTEsIDEpICogbWF4KGFicyhtYXBfZGF0YSRkaWZmX2NzcmVwcmVzc190cnVuYyksIG5hLnJtID0gVFJVRSksCiAgICAgICAgICAgICAgICAgICBicmVha3MgPSBzZXEoLTQsIDQsIDEpLCBuYS52YWx1ZSA9ICJncmV5ODAiKSArCiAgZ3VpZGVzKGZpbGwgPSBndWlkZV9jb2xvcmJhcihyZXZlcnNlID0gVFJVRSwgdGlja3MgPSBGQUxTRSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhcndpZHRoID0gdW5pdCg3LCB1bml0cyA9ICJsaW5lcyIpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFyaGVpZ2h0ID0gdW5pdCgwLjUsIHVuaXRzID0gImxpbmVzIikpKSArCiAgbGFicyhmaWxsID0gIkNoYW5nZSBpbiBWLURlbSBjaXZpbCBzb2NpZXR5IHJlcHJlc3Npb24gYmV0d2VlbiAyMDAwIGFuZCAyMDE0IikgKwogIHRoZW1lX25nbygpICsKICB0aGVtZShwYW5lbC5ib3JkZXIgPSBlbGVtZW50X2JsYW5rKCksCiAgICAgICAgbGVnZW5kLmJveC5tYXJnaW4gPSBtYXJnaW4odCA9IDUpLAogICAgICAgIGxlZ2VuZC50aXRsZSA9IGVsZW1lbnRfdGV4dGJveF9zaW1wbGUoaGFsaWduID0gMSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVoZWlnaHQgPSAxLjMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaW53aWR0aCA9IHVuaXQoMiwgImxpbmVzIiksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXh3a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