INGOs and governments

Code
library(tidyverse)
library(targets)
library(scales)
library(glue)
library(gt)
library(ggmosaic)
library(ggtext)
library(patchwork)
library(tidybayes)
library(here)
library(ggpattern)

tar_config_set(store = here('_targets'),
               script = here('_targets.R'))

tar_load(c(survey_orgs, survey_countries, survey_all))
tar_load(c(
  df_govt_positivity_regime, models_govt_positivity_regime,
  df_govt_positivity_issue, models_govt_positivity_issue,
  df_familiarity_regime, models_familiarity_regime,
  df_familiarity_issue, models_familiarity_issue,
  df_frequency_regime, models_frequency_regime,
  df_registration_regime, models_registration_regime,
  df_registration_issue, models_registration_issue
))

# Plotting functions
invisible(list2env(tar_read(graphic_functions), .GlobalEnv))
invisible(list2env(tar_read(table_functions), .GlobalEnv))

Relationship with host governments

Regime type

Code
ggplot(data = df_govt_positivity_regime) +
  geom_mosaic(aes(x = product(target.regime.type, Q4.11_collapsed), 
                  fill = target.regime.type),
              divider = mosaic("v"), 
              offset = 0, color = "white", linewidth = 1) +
  scale_fill_manual(values = c(clrs$Prism[4], clrs$Prism[6]),
                    guide = "none") +
  labs(x = "Target country regime type",
       y = "Relationship with target country",
       title = glue("How would you characterize your organization’s<br>",
                    "relationship with the government of {country}?",
                    country = build_span("target_country",
                                         c("font-family" = "Consolas", 
                                           "color" = clrs$Prism[1])))) +
  theme_ingo() +
  theme(panel.grid.major.x = element_blank(),
        panel.grid.major.y = element_blank(),
        plot.title = element_markdown(lineheight = 1.2))

Code
p1 <- models_govt_positivity_regime$draws %>% 
  ggplot(aes(x = .epred, y = Q4.11_collapsed, fill = Q4.11_collapsed)) +
  stat_halfeye() +
  scale_x_continuous(labels = label_percent()) +
  scale_fill_manual(values = c(clrs$Prism[7], clrs$Prism[12], clrs$Prism[2]),
                    guide = "none") +
  labs(x = "Posterior proportion", y = "Relationship with target country") +
  facet_wrap(vars("INGOs working in autocracies")) +
  theme_ingo()

plot_data <- models_govt_positivity_regime$diffs %>% 
  mutate(diffs = factor(Q4.11_collapsed, 
                        levels = c("Positive - Neither", "Neither - Negative", "Positive - Negative")))

diffs_summary <- plot_data %>% 
  group_by(diffs) %>% 
  median_qi(.epred, .width = c(0.5, 0.8, 0.95))

p2 <- models_govt_positivity_regime$diffs %>% 
  mutate(diffs = factor(Q4.11_collapsed, 
                        levels = c("Positive - Neither", "Neither - Negative", "Positive - Negative"))) %>% 
  ggplot(aes(x = .epred, fill = diffs, pattern_fill = diffs)) +
  geom_density_pattern(
    pattern = "stripe",
    pattern_density = 0.5,
    pattern_spacing = 0.2,
    pattern_size = 0,
    trim = TRUE,
    linewidth = 0
  ) +
  geom_pointinterval(data = diffs_summary, aes(x = .epred, xmin = .lower, xmax = .upper)) +
  geom_vline(xintercept = 0, linewidth = 0.5, color = clrs$Prism[8]) +
  facet_wrap(vars(diffs), ncol = 1) +
  scale_fill_manual(values = c(clrs$Prism[2], clrs$Prism[12], clrs$Prism[2]),
                    guide = "none") +
  scale_pattern_fill_manual(values = c(clrs$Prism[12], clrs$Prism[7], clrs$Prism[7]),
                            guide = "none") +
  scale_x_continuous(labels = label_number(scale = 100, style_negative = "minus",
                                           suffix = " pp."),
                     breaks = seq(-0.6, 0.2, by = 0.2)) +
  labs(x = "Percentage point differences", y = NULL) +
  theme_ingo() +
  theme(panel.grid.major.y = element_blank(),
        axis.text.y = element_blank())

p1 | p2

Code
models_govt_positivity_regime$draws %>% 
  median_qi(.epred) %>% 
  mutate(Q4.11_collapsed = as.character(Q4.11_collapsed),
         type = "Median proportions for INGOs working in autocracies") %>%
  rename(y = .epred, ymin = .lower, ymax = .upper) %>% 
  bind_rows(models_govt_positivity_regime$diffs_summary) %>% 
  mutate(across(c(y, ymin, ymax, p_greater_0), 
                list(nice = ~label_number(accuracy = 0.01)(.)))) %>% 
  mutate(nice_value = glue("{y_nice}<br>({ymin_nice} – {ymax_nice})")) %>% 
  mutate(Q4.11_collapsed = str_replace(Q4.11_collapsed, " - ", " − ")) %>% 
  select(type, Q4.11_collapsed, nice_value, p_greater_0_nice) %>% 
  group_by(type) %>% 
  gt() %>% 
  cols_label(
    Q4.11_collapsed = "",
    nice_value = "Posterior median",
    p_greater_0_nice = "p > 0"
  ) %>% 
  fmt_markdown(nice_value) %>% 
  sub_missing(p_greater_0_nice) %>% 
  tab_footnote(footnote = "95% credible intervals shown in parentheses") %>% 
  opts_theme()
Posterior median p > 0
Median proportions for INGOs working in autocracies
Negative

0.58
(0.46 – 0.70)

Neither

0.29
(0.22 – 0.37)

Positive

0.38
(0.32 – 0.43)

Differences
Neither − Negative

-0.29
(-0.43 – -0.14)

0.00
Positive − Negative

-0.20
(-0.34 – -0.07)

0.00
Positive − Neither

0.09
(-0.01 – 0.18)

0.96
95% credible intervals shown in parentheses

Issue contentiousness

Code
ggplot(data = df_govt_positivity_issue) +
  geom_mosaic(aes(x = product(potential.contentiousness, Q4.11_collapsed), 
                  fill = potential.contentiousness),
              divider = mosaic("v"), 
              offset = 0, color = "white", linewidth = 1) +
  scale_fill_manual(values = c(clrs$Prism[2], clrs$Prism[8]),
                    guide = "none") +
  labs(x = "Contentiousness of INGO work",
       y = "Relationship with target country",
       title = glue("How would you characterize your organization’s<br>",
                    "relationship with the government of {country}?",
                    country = build_span("target_country",
                                         c("font-family" = "Consolas", 
                                           "color" = clrs$Prism[1])))) +
  theme_ingo() +
  theme(panel.grid.major.x = element_blank(),
        panel.grid.major.y = element_blank(),
        plot.title = element_markdown(lineheight = 1.2))

Code
p1 <- models_govt_positivity_issue$draws %>% 
  ggplot(aes(x = .epred, y = Q4.11_collapsed, fill = Q4.11_collapsed)) +
  stat_halfeye() +
  scale_x_continuous(labels = label_percent()) +
  scale_fill_manual(values = c(clrs$Prism[7], clrs$Prism[12], clrs$Prism[2]),
                    guide = "none") +
  labs(x = "Posterior proportion", y = "Relationship with target country") +
  facet_wrap(vars("INGOs with contentious issues")) +
  theme_ingo()

plot_data <- models_govt_positivity_issue$diffs %>% 
  mutate(diffs = factor(Q4.11_collapsed, 
                        levels = c("Positive - Neither", "Neither - Negative", "Positive - Negative")))

diffs_summary <- plot_data %>% 
  group_by(diffs) %>% 
  median_qi(.epred, .width = c(0.5, 0.8, 0.95))

p2 <- plot_data %>% 
  ggplot(aes(x = .epred, fill = diffs, pattern_fill = diffs)) +
  geom_density_pattern(
    # aes(y = after_stat(density * 1e5)),
    pattern = "stripe",
    pattern_density = 0.5,
    pattern_spacing = 0.2,
    pattern_size = 0,
    trim = TRUE,
    linewidth = 0
  ) +
  geom_pointinterval(data = diffs_summary, aes(x = .epred, xmin = .lower, xmax = .upper)) +
  geom_vline(xintercept = 0, linewidth = 0.5, color = clrs$Prism[8]) +
  facet_wrap(vars(diffs), ncol = 1) +
  scale_fill_manual(values = c(clrs$Prism[2], clrs$Prism[12], clrs$Prism[2]),
                    guide = "none") +
  scale_pattern_fill_manual(values = c(clrs$Prism[12], clrs$Prism[7], clrs$Prism[7]),
                            guide = "none") +
  scale_x_continuous(labels = label_number(scale = 100, style_negative = "minus",
                                           suffix = "\n pp."),
                     breaks = seq(-0.4, 0.1, by = 0.1)) +
  labs(x = "Percentage point differences", y = NULL) +
  theme_ingo() +
  theme(panel.grid.major.y = element_blank(),
        axis.text.y = element_blank())

p1 | p2

Code
models_govt_positivity_issue$draws %>% 
  median_qi(.epred) %>% 
  mutate(Q4.11_collapsed = as.character(Q4.11_collapsed),
         type = "Median proportions for NGOs working on contentious issues") %>%
  rename(y = .epred, ymin = .lower, ymax = .upper) %>% 
  bind_rows(models_govt_positivity_issue$diffs_summary) %>% 
  mutate(across(c(y, ymin, ymax, p_greater_0), 
                list(nice = ~label_number(accuracy = 0.01)(.)))) %>% 
  mutate(nice_value = glue("{y_nice}<br>({ymin_nice} – {ymax_nice})")) %>% 
  mutate(Q4.11_collapsed = str_replace(Q4.11_collapsed, " - ", " − ")) %>% 
  select(type, Q4.11_collapsed, nice_value, p_greater_0_nice) %>% 
  group_by(type) %>% 
  gt() %>% 
  cols_label(
    Q4.11_collapsed = "",
    nice_value = "Posterior median",
    p_greater_0_nice = "p > 0"
  ) %>% 
  fmt_markdown(nice_value) %>% 
  sub_missing(p_greater_0_nice) %>% 
  tab_footnote(footnote = "95% credible intervals shown in parentheses") %>% 
  opts_theme()
Posterior median p > 0
Median proportions for NGOs working on contentious issues
Negative

0.50
(0.38 – 0.62)

Neither

0.32
(0.25 – 0.40)

Positive

0.32
(0.26 – 0.37)

Differences
Neither − Negative

-0.18
(-0.32 – -0.03)

0.01
Positive − Negative

-0.18
(-0.32 – -0.05)

0.00
Positive − Neither

-0.01
(-0.10 – 0.08)

0.43
95% credible intervals shown in parentheses

Experiences with regulations

Familiarity with regulations

Regime type

Code
ggplot(data = df_familiarity_regime) +
  geom_mosaic(
    aes(
      x = product(target.regime.type, Q4.13_collapsed),
      fill = target.regime.type
    ),
    divider = mosaic("v"),
    offset = 0, color = "white", linewidth = 1
  ) +
  scale_fill_manual(
    values = c(clrs$Prism[4], clrs$Prism[6]),
    guide = "none"
  ) +
  labs(
    x = "Target country regime type",
    y = "Familiarity with regulations"
  ) +
  theme_ingo() +
  theme(
    panel.grid.major.x = element_blank(),
    panel.grid.major.y = element_blank(),
    plot.title = element_markdown(lineheight = 1.2)
  )

Code
p1 <- models_familiarity_regime$draws %>%
  ggplot(aes(x = .epred, y = Q4.13_collapsed, fill = Q4.13_collapsed)) +
  stat_halfeye() +
  scale_x_continuous(labels = label_percent()) +
  scale_fill_manual(
    values = c(clrs$Prism[7], clrs$Prism[12], clrs$Prism[2]),
    guide = "none"
  ) +
  labs(x = "Posterior proportion", y = "Familiarity with regulations") +
  facet_wrap(vars("INGOs working in autocracies")) +
  theme_ingo()

plot_data <- models_familiarity_regime$diffs %>%
  mutate(diffs = factor(Q4.13_collapsed,
    levels = c(
      "Not familiar at all - Somewhat familiar",
      "Somewhat familiar - Very familiar",
      "Not familiar at all - Very familiar"
    )
  ))

diffs_summary <- plot_data %>% 
  group_by(diffs) %>% 
  median_qi(.epred, .width = c(0.5, 0.8, 0.95))

p2 <- models_familiarity_regime$diffs %>% 
  mutate(diffs = factor(Q4.13_collapsed,
    levels = c(
      "Not familiar at all - Somewhat familiar",
      "Somewhat familiar - Very familiar",
      "Not familiar at all - Very familiar"
    )
  )) %>%  
  ggplot(aes(x = .epred, fill = diffs, pattern_fill = diffs)) +
  geom_density_pattern(
    pattern = "stripe",
    pattern_density = 0.5,
    pattern_spacing = 0.2,
    pattern_size = 0,
    trim = TRUE,
    linewidth = 0
  ) +
  geom_pointinterval(data = diffs_summary, aes(x = .epred, xmin = .lower, xmax = .upper)) +
  geom_vline(xintercept = 0, linewidth = 0.5, color = clrs$Prism[8]) +
  facet_wrap(vars(diffs), ncol = 1) +
  scale_fill_manual(values = c(clrs$Prism[2], clrs$Prism[12], clrs$Prism[2]),
                    guide = "none") +
  scale_pattern_fill_manual(values = c(clrs$Prism[12], clrs$Prism[7], clrs$Prism[7]),
                            guide = "none") +
  scale_x_continuous(labels = label_number(scale = 100, style_negative = "minus",
                                           suffix = " pp."),
                     breaks = seq(-0.6, 0.2, by = 0.2)) +
  labs(x = "Percentage point differences", y = NULL) +
  theme_ingo() +
  theme(panel.grid.major.y = element_blank(),
        axis.text.y = element_blank())

p1 | p2

Code
models_familiarity_regime$draws %>% 
  median_qi(.epred) %>% 
  mutate(Q4.13_collapsed = as.character(Q4.13_collapsed),
         type = "Median proportions for INGOs working in autocracies") %>%
  rename(y = .epred, ymin = .lower, ymax = .upper) %>% 
  bind_rows(models_familiarity_regime$diffs_summary) %>% 
  mutate(across(c(y, ymin, ymax, p_greater_0), 
                list(nice = ~label_number(accuracy = 0.01)(.)))) %>% 
  mutate(nice_value = glue("{y_nice}<br>({ymin_nice} – {ymax_nice})")) %>% 
  mutate(Q4.13_collapsed = str_replace(Q4.13_collapsed, " - ", " − ")) %>% 
  select(type, Q4.13_collapsed, nice_value, p_greater_0_nice) %>% 
  group_by(type) %>% 
  gt() %>% 
  cols_label(
    Q4.13_collapsed = "",
    nice_value = "Posterior median",
    p_greater_0_nice = "p > 0"
  ) %>% 
  fmt_markdown(nice_value) %>% 
  sub_missing(p_greater_0_nice) %>% 
  tab_footnote(footnote = "95% credible intervals shown in parentheses") %>% 
  opts_theme()
Posterior median p > 0
Median proportions for INGOs working in autocracies
Not familiar at all

0.25
(0.17 – 0.34)

Somewhat familiar

0.33
(0.27 – 0.39)

Very familiar

0.43
(0.37 – 0.50)

Differences
Not familiar at all − Somewhat familiar

-0.08
(-0.18 – 0.04)

0.08
Not familiar at all − Very familiar

-0.18
(-0.28 – -0.07)

0.00
Somewhat familiar − Very familiar

-0.10
(-0.19 – -0.02)

0.01
95% credible intervals shown in parentheses

Issue contentiousness

Code
ggplot(data = df_familiarity_issue) +
  geom_mosaic(aes(x = product(potential.contentiousness, Q4.13_collapsed), 
                  fill = potential.contentiousness),
              divider = mosaic("v"), 
              offset = 0, color = "white", linewidth = 1) +
  scale_fill_manual(values = c(clrs$Prism[2], clrs$Prism[8]),
                    guide = "none") +
  labs(x = "Contentiousness of INGO work",
       y = "Familiarity with regulations") +
  theme_ingo() +
  theme(panel.grid.major.x = element_blank(),
        panel.grid.major.y = element_blank(),
        plot.title = element_markdown(lineheight = 1.2))

Code
p1 <- models_familiarity_issue$draws %>% 
  ggplot(aes(x = .epred, y = Q4.13_collapsed, fill = Q4.13_collapsed)) +
  stat_halfeye() +
  scale_x_continuous(labels = label_percent()) +
  scale_fill_manual(values = c(clrs$Prism[7], clrs$Prism[12], clrs$Prism[2]),
                    guide = "none") +
  labs(x = "Posterior proportion", y = "Familiarity with regulations") +
  facet_wrap(vars("INGOs with contentious issues")) +
  theme_ingo()

plot_data <- models_familiarity_issue$diffs %>% 
  mutate(diffs = factor(Q4.13_collapsed,
    levels = c(
      "Not familiar at all - Somewhat familiar",
      "Somewhat familiar - Very familiar",
      "Not familiar at all - Very familiar"
    )
  ))

diffs_summary <- plot_data %>% 
  group_by(diffs) %>% 
  median_qi(.epred, .width = c(0.5, 0.8, 0.95))

p2 <- plot_data %>% 
  ggplot(aes(x = .epred, fill = diffs, pattern_fill = diffs)) +
  geom_density_pattern(
    # aes(y = after_stat(density * 1e5)),
    pattern = "stripe",
    pattern_density = 0.5,
    pattern_spacing = 0.2,
    pattern_size = 0,
    trim = TRUE,
    linewidth = 0
  ) +
  geom_pointinterval(data = diffs_summary, aes(x = .epred, xmin = .lower, xmax = .upper)) +
  geom_vline(xintercept = 0, linewidth = 0.5, color = clrs$Prism[8]) +
  facet_wrap(vars(diffs), ncol = 1) +
  scale_fill_manual(values = c(clrs$Prism[2], clrs$Prism[12], clrs$Prism[2]),
                    guide = "none") +
  scale_pattern_fill_manual(values = c(clrs$Prism[12], clrs$Prism[7], clrs$Prism[7]),
                            guide = "none") +
  scale_x_continuous(labels = label_number(scale = 100, style_negative = "minus",
                                           suffix = "\n pp."),
                     breaks = seq(-0.4, 0.1, by = 0.1)) +
  labs(x = "Percentage point differences", y = NULL) +
  theme_ingo() +
  theme(panel.grid.major.y = element_blank(),
        axis.text.y = element_blank())

p1 | p2

Code
models_familiarity_issue$draws %>% 
  median_qi(.epred) %>% 
  mutate(Q4.13_collapsed = as.character(Q4.13_collapsed),
         type = "Median proportions for NGOs working on contentious issues") %>%
  rename(y = .epred, ymin = .lower, ymax = .upper) %>% 
  bind_rows(models_familiarity_issue$diffs_summary) %>% 
  mutate(across(c(y, ymin, ymax, p_greater_0), 
                list(nice = ~label_number(accuracy = 0.01)(.)))) %>% 
  mutate(nice_value = glue("{y_nice}<br>({ymin_nice} – {ymax_nice})")) %>% 
  mutate(Q4.13_collapsed = str_replace(Q4.13_collapsed, " - ", " − ")) %>% 
  select(type, Q4.13_collapsed, nice_value, p_greater_0_nice) %>% 
  group_by(type) %>% 
  gt() %>% 
  cols_label(
    Q4.13_collapsed = "",
    nice_value = "Posterior median",
    p_greater_0_nice = "p > 0"
  ) %>% 
  fmt_markdown(nice_value) %>% 
  sub_missing(p_greater_0_nice) %>% 
  tab_footnote(footnote = "95% credible intervals shown in parentheses") %>% 
  opts_theme()
Posterior median p > 0
Median proportions for NGOs working on contentious issues
Not familiar at all

0.29
(0.21 – 0.39)

Very familiar

0.27
(0.22 – 0.34)

Somewhat familiar

0.37
(0.31 – 0.43)

Differences
Not familiar at all − Somewhat familiar

-0.08
(-0.18 – 0.03)

0.09
Not familiar at all − Very familiar

0.02
(-0.09 – 0.13)

0.65
Somewhat familiar − Very familiar

0.10
(0.01 – 0.18)

0.98
95% credible intervals shown in parentheses

Frequency of changes

Code
ggplot(data = df_frequency_regime) +
  geom_mosaic(
    aes(
      x = product(target.regime.type, Q4.14_collapsed),
      fill = target.regime.type
    ),
    divider = mosaic("v"),
    offset = 0, color = "white", linewidth = 1
  ) +
  scale_fill_manual(
    values = c(clrs$Prism[4], clrs$Prism[6]),
    guide = "none"
  ) +
  labs(
    x = "Target country regime type",
    y = "Frequency of changes in regulations"
  ) +
  theme_ingo() +
  theme(
    panel.grid.major.x = element_blank(),
    panel.grid.major.y = element_blank(),
    plot.title = element_markdown(lineheight = 1.2)
  )

Code
p1 <- models_frequency_regime$draws %>%
  ggplot(aes(x = .epred, y = Q4.14_collapsed, fill = Q4.14_collapsed)) +
  stat_halfeye() +
  scale_x_continuous(labels = label_percent()) +
  scale_fill_manual(
    values = c(clrs$Prism[7], clrs$Prism[12], clrs$Prism[2]),
    guide = "none"
  ) +
  labs(x = "Posterior proportion", y = "Frequency of changes in regulations") +
  facet_wrap(vars("INGOs working in autocracies")) +
  theme_ingo()

plot_data <- models_frequency_regime$diffs %>%
  mutate(diffs = factor(Q4.14_collapsed,
    levels = c(
      "Rarely or never - Once every few years",
      "Once every few years - At least once a year",
      "Rarely or never - At least once a year"
    )
  ))

diffs_summary <- plot_data %>% 
  group_by(diffs) %>% 
  median_qi(.epred, .width = c(0.5, 0.8, 0.95))

p2 <- models_frequency_regime$diffs %>% 
  mutate(diffs = factor(Q4.14_collapsed,
    levels = c(
      "Rarely or never - Once every few years",
      "Once every few years - At least once a year",
      "Rarely or never - At least once a year"
    )
  )) %>% 
  ggplot(aes(x = .epred, fill = diffs, pattern_fill = diffs)) +
  geom_density_pattern(
    pattern = "stripe",
    pattern_density = 0.5,
    pattern_spacing = 0.2,
    pattern_size = 0,
    trim = TRUE,
    linewidth = 0
  ) +
  geom_pointinterval(data = diffs_summary, aes(x = .epred, xmin = .lower, xmax = .upper)) +
  geom_vline(xintercept = 0, linewidth = 0.5, color = clrs$Prism[8]) +
  facet_wrap(vars(diffs), ncol = 1) +
  scale_fill_manual(values = c(clrs$Prism[2], clrs$Prism[12], clrs$Prism[2]),
                    guide = "none") +
  scale_pattern_fill_manual(values = c(clrs$Prism[12], clrs$Prism[7], clrs$Prism[7]),
                            guide = "none") +
  scale_x_continuous(labels = label_number(scale = 100, style_negative = "minus",
                                           suffix = " pp."),
                     breaks = seq(-0.6, 0.2, by = 0.2)) +
  labs(x = "Percentage point differences", y = NULL) +
  theme_ingo() +
  theme(panel.grid.major.y = element_blank(),
        axis.text.y = element_blank())

p1 | p2

Code
models_frequency_regime$draws %>% 
  median_qi(.epred) %>% 
  mutate(Q4.14_collapsed = as.character(Q4.14_collapsed),
         type = "Median proportions for INGOs working in autocracies") %>%
  rename(y = .epred, ymin = .lower, ymax = .upper) %>% 
  bind_rows(models_frequency_regime$diffs_summary) %>% 
  mutate(across(c(y, ymin, ymax, p_greater_0), 
                list(nice = ~label_number(accuracy = 0.01)(.)))) %>% 
  mutate(nice_value = glue("{y_nice}<br>({ymin_nice} – {ymax_nice})")) %>% 
  mutate(Q4.14_collapsed = str_replace(Q4.14_collapsed, " - ", " − ")) %>% 
  select(type, Q4.14_collapsed, nice_value, p_greater_0_nice) %>% 
  group_by(type) %>% 
  gt() %>% 
  cols_label(
    Q4.14_collapsed = "",
    nice_value = "Posterior median",
    p_greater_0_nice = "p > 0"
  ) %>% 
  fmt_markdown(nice_value) %>% 
  sub_missing(p_greater_0_nice) %>% 
  tab_footnote(footnote = "95% credible intervals shown in parentheses") %>% 
  opts_theme()
Posterior median p > 0
Median proportions for INGOs working in autocracies
At least once a year

0.56
(0.44 – 0.68)

Once every few years

0.41
(0.33 – 0.50)

Rarely or never

0.35
(0.27 – 0.43)

Differences
Once every few years − At least once a year

-0.15
(-0.29 – 0.00)

0.02
Rarely or never − At least once a year

-0.22
(-0.36 – -0.07)

0.00
Rarely or never − Once every few years

-0.07
(-0.19 – 0.05)

0.14
95% credible intervals shown in parentheses

How NGOs find out about changes

Code
df_change_how <- survey_countries %>%
  unnest(Q4.15_value) %>%
  group_by(Q4.15_value) %>%
  summarise(num = n()) %>%
  arrange(desc(num)) %>%
  filter(!is.na(Q4.15_value)) %>%
  mutate(how = fct_inorder(Q4.15_value)) %>%
  mutate(how = fct_recode(how,
    "Newspapers, television,\nand other media" = "Newspapers, television, and other media", 
    NULL = "Don't know"
  )) %>%
  filter(!is.na(how))

ggplot(df_change_how, aes(x = num, y = fct_rev(how))) +
  geom_pointrange(aes(xmin = 0, xmax = num)) +
  scale_x_continuous(
    sec.axis = sec_axis(~ . / nrow(survey_countries),
    labels = label_percent()
  )) +
  labs(x = "Times selected", y = NULL) +
  theme_ingo() +
  theme(panel.grid.major.y = element_blank())

Code

# What are the other ways?
df_change_how_other <- survey_countries %>%
  filter(!is.na(Q4.15_other_TEXT)) %>%
  select(clean.id, Q4.15_other_TEXT) %>%
  arrange(Q4.15_other_TEXT)

Are NGOs registered?

Regime type

Code
ggplot(data = df_registration_regime) +
  geom_mosaic(
    aes(
      x = product(target.regime.type, Q4.4_collapsed),
      fill = target.regime.type
    ),
    divider = mosaic("v"),
    offset = 0, color = "white", linewidth = 1
  ) +
  scale_fill_manual(
    values = c(clrs$Prism[4], clrs$Prism[6]),
    guide = "none"
  ) +
  labs(
    x = "Target country regime type",
    y = "Registration status"
  ) +
  theme_ingo() +
  theme(
    panel.grid.major.x = element_blank(),
    panel.grid.major.y = element_blank(),
    plot.title = element_markdown(lineheight = 1.2)
  )

Code
p1 <- models_registration_regime$draws %>%
  ggplot(aes(x = .epred, y = Q4.4_collapsed, fill = Q4.4_collapsed)) +
  stat_halfeye() +
  scale_x_continuous(labels = label_percent()) +
  scale_fill_manual(
    values = c(clrs$Prism[7], clrs$Prism[2]),
    guide = "none"
  ) +
  labs(x = "Posterior proportion", y = "Registration status") +
  facet_wrap(vars("INGOs working in autocracies")) +
  theme_ingo()

plot_data <- models_registration_regime$diffs %>%
  mutate(diffs = factor(Q4.4_collapsed))

diffs_summary <- plot_data %>% 
  group_by(diffs) %>% 
  median_qi(.epred, .width = c(0.5, 0.8, 0.95))

p2 <- models_registration_regime$diffs %>% 
  mutate(diffs = factor(Q4.4_collapsed)) %>% 
  ggplot(aes(x = .epred, fill = diffs, pattern_fill = diffs)) +
  geom_density_pattern(
    pattern = "stripe",
    pattern_density = 0.5,
    pattern_spacing = 0.2,
    pattern_size = 0,
    trim = TRUE,
    linewidth = 0
  ) +
  geom_pointinterval(data = diffs_summary, aes(x = .epred, xmin = .lower, xmax = .upper)) +
  geom_vline(xintercept = 0, linewidth = 0.5, color = clrs$Prism[8]) +
  facet_wrap(vars(diffs), ncol = 1) +
  scale_fill_manual(values = c(clrs$Prism[2]),
                    guide = "none") +
  scale_pattern_fill_manual(values = c(clrs$Prism[7]),
                            guide = "none") +
  scale_x_continuous(labels = label_number(scale = 100, style_negative = "minus",
                                           suffix = " pp."),
                     breaks = seq(-0.4, 0.4, by = 0.1)) +
  labs(x = "Percentage point differences", y = NULL) +
  theme_ingo() +
  theme(panel.grid.major.y = element_blank(),
        axis.text.y = element_blank())

p1 | p2

Code
models_registration_regime$draws %>% 
  median_qi(.epred) %>% 
  mutate(Q4.4_collapsed = as.character(Q4.4_collapsed),
         type = "Median proportions for INGOs working in autocracies") %>%
  rename(y = .epred, ymin = .lower, ymax = .upper) %>% 
  bind_rows(models_registration_regime$diffs_summary) %>% 
  mutate(across(c(y, ymin, ymax, p_greater_0), 
                list(nice = ~label_number(accuracy = 0.01)(.)))) %>% 
  mutate(nice_value = glue("{y_nice}<br>({ymin_nice} – {ymax_nice})")) %>% 
  mutate(Q4.4_collapsed = str_replace(Q4.4_collapsed, " - ", " − ")) %>% 
  select(type, Q4.4_collapsed, nice_value, p_greater_0_nice) %>% 
  group_by(type) %>% 
  gt() %>% 
  cols_label(
    Q4.4_collapsed = "",
    nice_value = "Posterior median",
    p_greater_0_nice = "p > 0"
  ) %>% 
  fmt_markdown(nice_value) %>% 
  sub_missing(p_greater_0_nice) %>% 
  tab_footnote(footnote = "95% credible intervals shown in parentheses") %>% 
  opts_theme()
Posterior median p > 0
Median proportions for INGOs working in autocracies
Not registered

0.34
(0.29 – 0.39)

Registered

0.37
(0.32 – 0.43)

Differences
Not registered − Registered

-0.04
(-0.11 – 0.04)

0.17
95% credible intervals shown in parentheses

Issue contentiousness

Code
ggplot(data = df_registration_issue) +
  geom_mosaic(aes(x = product(potential.contentiousness, Q4.4_collapsed), 
                  fill = potential.contentiousness),
              divider = mosaic("v"), 
              offset = 0, color = "white", linewidth = 1) +
  scale_fill_manual(values = c(clrs$Prism[2], clrs$Prism[8]),
                    guide = "none") +
  labs(x = "Contentiousness of INGO work",
       y = "Registration status") +
  theme_ingo() +
  theme(panel.grid.major.x = element_blank(),
        panel.grid.major.y = element_blank(),
        plot.title = element_markdown(lineheight = 1.2))

Code
p1 <- models_registration_issue$draws %>% 
  ggplot(aes(x = .epred, y = Q4.4_collapsed, fill = Q4.4_collapsed)) +
  stat_halfeye() +
  scale_x_continuous(labels = label_percent()) +
  scale_fill_manual(values = c(clrs$Prism[7], clrs$Prism[2]),
                    guide = "none") +
  labs(x = "Posterior proportion", y = "Registration status") +
  facet_wrap(vars("INGOs with contentious issues")) +
  theme_ingo()

plot_data <- models_registration_issue$diffs %>% 
  mutate(diffs = factor(Q4.4_collapsed))

diffs_summary <- plot_data %>% 
  group_by(diffs) %>% 
  median_qi(.epred, .width = c(0.5, 0.8, 0.95))

p2 <- plot_data %>% 
  ggplot(aes(x = .epred, fill = diffs, pattern_fill = diffs)) +
  geom_density_pattern(
    # aes(y = after_stat(density * 1e5)),
    pattern = "stripe",
    pattern_density = 0.5,
    pattern_spacing = 0.2,
    pattern_size = 0,
    trim = TRUE,
    linewidth = 0
  ) +
  geom_pointinterval(data = diffs_summary, aes(x = .epred, xmin = .lower, xmax = .upper)) +
  geom_vline(xintercept = 0, linewidth = 0.5, color = clrs$Prism[8]) +
  facet_wrap(vars(diffs), ncol = 1) +
  scale_fill_manual(values = c(clrs$Prism[2]),
                    guide = "none") +
  scale_pattern_fill_manual(values = c(clrs$Prism[7]),
                            guide = "none") +
  scale_x_continuous(labels = label_number(scale = 100, style_negative = "minus",
                                           suffix = "\n pp."),
                     breaks = seq(-0.4, 0.1, by = 0.1)) +
  labs(x = "Percentage point differences", y = NULL) +
  theme_ingo() +
  theme(panel.grid.major.y = element_blank(),
        axis.text.y = element_blank())

p1 | p2

Code
models_registration_issue$draws %>% 
  median_qi(.epred) %>% 
  mutate(Q4.4_collapsed = as.character(Q4.4_collapsed),
         type = "Median proportions for NGOs working on contentious issues") %>%
  rename(y = .epred, ymin = .lower, ymax = .upper) %>% 
  bind_rows(models_registration_issue$diffs_summary) %>% 
  mutate(across(c(y, ymin, ymax, p_greater_0), 
                list(nice = ~label_number(accuracy = 0.01)(.)))) %>% 
  mutate(nice_value = glue("{y_nice}<br>({ymin_nice} – {ymax_nice})")) %>% 
  mutate(Q4.4_collapsed = str_replace(Q4.4_collapsed, " - ", " − ")) %>% 
  select(type, Q4.4_collapsed, nice_value, p_greater_0_nice) %>% 
  group_by(type) %>% 
  gt() %>% 
  cols_label(
    Q4.4_collapsed = "",
    nice_value = "Posterior median",
    p_greater_0_nice = "p > 0"
  ) %>% 
  fmt_markdown(nice_value) %>% 
  sub_missing(p_greater_0_nice) %>% 
  tab_footnote(footnote = "95% credible intervals shown in parentheses") %>% 
  opts_theme()
Posterior median p > 0
Median proportions for NGOs working on contentious issues
Registered

0.30
(0.25 – 0.35)

Not registered

0.34
(0.29 – 0.40)

Differences
Not registered − Registered

0.04
(-0.03 – 0.12)

0.88
95% credible intervals shown in parentheses

Government involvement in INGO activity

Contact and reporting frequency

Code
df_freq_report <- survey_all %>%
  mutate(Q4.8.collapsed = fct_recode(Q4.8.clean,
    `More than once a year` = "More than once a week",
    `More than once a year` = "Once a week",
    `More than once a year` = "More than once a month,\nless than once a week",
    `More than once a year` = "Once a month",
    `More than once a year` = "More than once a year,\nless than once a month",
    `Annually` = "Once a year",
    `Once every 2+ years` = "Once every 2+ years",
    `Never` = "Rarely",
    `Never` = "Never",
    `As necessary` = "As necessary/depends",
    NULL = "Don't know"
  )) %>%
  mutate(Q4.8.collapsed = fct_relevel(Q4.8.collapsed, "As necessary", after = 1)) %>%
  filter(!is.na(Q4.8.collapsed)) %>%
  group_by(target.regime.type, Q4.8.collapsed) %>%
  summarise(num = n()) %>%
  rename(freq = Q4.8.collapsed)
Code
df_freq_contact <- survey_all %>%
  mutate(Q4.5.collapsed = fct_recode(Q4.5.clean,
    `More than once a year` = "More than once a week",
    `More than once a year` = "Once a week",
    `More than once a year` = "More than once a month,\nless than once a week",
    `More than once a year` = "Once a month",
    `More than once a year` = "More than once a year,\nless than once a month",
    `Annually` = "Once a year",
    `Once every 2+ years` = "Once every 2+ years",
    `Never` = "Rarely",
    `Never` = "Never",
    `As necessary` = "As necessary/depends",
    NULL = "Don't know"
  )) %>%
  mutate(Q4.5.collapsed = fct_relevel(Q4.5.collapsed, "As necessary", after = 1)) %>%
  filter(!is.na(Q4.5.collapsed)) %>%
  group_by(target.regime.type, Q4.5.collapsed) %>%
  summarise(num = n()) %>%
  rename(freq = Q4.5.collapsed)
Code
df_freq_both <- bind_rows(
  df_freq_contact,
  df_freq_report,
  .id = "report.type"
) %>%
  mutate(report.type = recode(
    report.type,
    `1` = "Contact with the government",
    `2` = "Reporting to the government"
  ))

ggplot(
  df_freq_both,
  aes(
    x = num, y = freq,
    colour = target.regime.type
  )
) +
  geom_pointrange(
    aes(xmin = 0, xmax = num),
    position = position_dodge(width = 0.5),
    size = 0.5
  ) +
  scale_colour_manual(
    values = c(clrs$Prism[4], clrs$Prism[6]), name = NULL
  ) +
  guides(colour = guide_legend(reverse = TRUE)) +
  labs(x = "Number of responses", y = NULL) +
  facet_wrap(vars(report.type)) +
  theme_ingo() +
  theme(panel.grid.major.y = element_blank())

Code
df_officials_contact_most <- survey_all %>%
  group_by(Q4.7) %>%
  summarise(num = n()) %>%
  arrange(desc(num)) %>%
  filter(!is.na(Q4.7)) %>%
  mutate(issue = factor(Q4.7, levels = rev(Q4.7), ordered = TRUE))

ggplot(
  df_officials_contact_most,
  aes(x = num, y = issue)
) +
  geom_pointrange(aes(xmin = 0, xmax = num)) +
  labs(x = "Times selected", y = NULL) +
  theme_ingo() +
  theme(panel.grid.major.y = element_blank())