library(tidyverse)
library(targets)
library(scales)
library(patchwork)
library(kableExtra)
library(sf)
library(here)
# Load data
withr::with_dir(here::here(), {
source(tar_read(plot_funs))
source(tar_read(misc_funs))
df_donor <- tar_read(donor_level_data)
df_donor_us <- tar_read(donor_level_data_usaid)
df_country_aid <- tar_read(country_aid_final)
df_country_aid_laws <- filter(df_country_aid, laws)
df_autocracies <- tar_read(autocracies)
vars_to_summarize <- tar_read(var_details) %>%
mutate(summary_order = 1:n())
tar_load(c(ngo_index_table, regulations))
tar_load(c(civicus_map_data, civicus_clean))
})
my_seed <- 1234
set.seed(my_seed)num_countries <- df_country_aid_laws %>% distinct(gwcode) %>% nrow()
num_years <- df_country_aid_laws %>% distinct(year) %>% nrow()
year_first <- df_country_aid_laws %>% distinct(year) %>% min()
year_last <- df_country_aid_laws %>% distinct(year) %>% max()Our data includes information about 142 countries across 24 years (from 1990–2013)
(From our AJPS submission): The values here are slightly different from what we had at ISA and MPSA (and our ISQ submission) because we’re now using V-Dem 8.0 and AidData 3.1.
And now the values are even different-er, since we’re using V-Dem 10.0 and have really clean data now.
vars_summarized <- df_country_aid_laws %>%
select(one_of(vars_to_summarize$term)) %>%
mutate(total_oda = total_oda / 1000000) %>%
mutate(gdpcap_log = exp(gdpcap_log)) %>%
pivot_longer(names_to = "term", values_to = "value", everything()) %>%
filter(!is.na(value)) %>%
group_by(term) %>%
summarize(N = n(),
Mean = mean(value),
Median = median(value),
`Std. Dev.` = sd(value),
Min = min(value),
Max = max(value)) %>%
ungroup() %>%
left_join(vars_to_summarize, by = "term") %>%
arrange(summary_order) %>%
mutate(across(c(Mean, `Std. Dev.`, Median, Min, Max),
~case_when(
format == "percent" ~ percent_format(accuracy = 0.1)(.),
format == "dollar" ~ dollar_format(accuracy = 1)(.),
format == "number" ~ comma_format(accuracy = 0.1)(.)))) %>%
mutate(N = comma(N)) %>%
select(category, subcategory, Variable = term_clean_table, Source = source,
Mean, `Std. Dev.`, Median, Min, Max, N)
vars_summarized %>%
select(-category, ` ` = subcategory) %>%
kbl() %>%
kable_styling() %>%
pack_rows(index = table(fct_inorder(vars_summarized$category))) %>%
collapse_rows(columns = 1, valign = "top")| Variable | Source | Mean | Std. Dev. | Median | Min | Max | N | |
|---|---|---|---|---|---|---|---|---|
| Outcome | ||||||||
| Total aid (constant 2011 USD, millions) | OECD and AidData | $1,316 | $2,968 | $483 | $0 | $63,233 | 3,293 | |
| Proportion of contentious aid | OECD and AidData | 7.1% | 10.5% | 3.3% | 0.0% | 100.0% | 3,293 | |
| Proportion of aid to domestic NGOs | USAID | 4.1% | 13.8% | 0.1% | 0.0% | 100.0% | 3,293 | |
| Proportion of aid to foreign NGOs | USAID | 12.9% | 20.1% | 0.7% | 0.0% | 100.0% | 3,293 | |
| Treatment | ||||||||
| Total legal barriers | Chaudhry (2016) | 1.5 | 1.9 | 1.0 | 0.0 | 9.5 | 3,293 | |
| Barriers to advocacy | Chaudhry (2016) | 0.3 | 0.5 | 0.0 | 0.0 | 2.0 | 3,293 | |
| Barriers to entry | Chaudhry (2016) | 0.8 | 0.9 | 1.0 | 0.0 | 3.0 | 3,293 | |
| Barriers to funding | Chaudhry (2016) | 0.4 | 0.9 | 0.0 | 0.0 | 4.5 | 3,293 | |
| Core civil society index | Chaudhry (2016) | 0.6 | 0.3 | 0.7 | 0.0 | 1.0 | 3,293 | |
| Confounders | ||||||||
| Human rights and politics | Electoral democracy index (polyarchy) | Coppedge et al. (2020) | 0.4 | 0.2 | 0.4 | 0.0 | 0.9 | 3,293 |
| Political corruption index | Coppedge et al. (2020) | 0.6 | 0.3 | 0.7 | 0.0 | 1.0 | 3,293 | |
| Rule of law index | Coppedge et al. (2020) | 0.5 | 0.3 | 0.4 | 0.0 | 1.0 | 3,293 | |
| Civil liberties index | Coppedge et al. (2020) | 0.6 | 0.2 | 0.7 | 0.0 | 1.0 | 3,293 | |
| Physical violence index | Coppedge et al. (2020) | 0.6 | 0.3 | 0.6 | 0.0 | 1.0 | 3,293 | |
| Private civil liberties index | Coppedge et al. (2020) | 0.6 | 0.3 | 0.7 | 0.0 | 1.0 | 3,293 | |
| Economics and development | GDP per capita (constant 2011 USD) | UN | $6,359 | $10,440 | $2,726 | $92 | $82,410 | 3,293 |
| Trade as % of GDP | UN | 78.1% | 46.0% | 69.2% | 1.9% | 441.6% | 3,293 | |
| Educational equality | Coppedge et al. (2020) | 0.1 | 1.3 | -0.1 | -3.2 | 3.6 | 3,293 | |
| Health equality | Coppedge et al. (2020) | 0.1 | 1.4 | -0.1 | -3.3 | 3.5 | 3,293 | |
| Infant mortality rate (deaths per 1,000 births) | Coppedge et al. (2020) | 45.3 | 34.6 | 35.9 | 2.2 | 171.0 | 3,293 | |
| Unexpected shocks | Internal conflict in last 5 years | UCDP/PRIO | 0.3 | 0.5 | 0.0 | 0.0 | 1.0 | 3,293 |
| Natural disasters | EM-DAT | 2.1 | 3.5 | 1.0 | 0.0 | 43.0 | 3,293 | |
total_oecd_aid <- df_country_aid_laws %>%
summarise(total = dollar(sum(total_oda))) %>%
pull(total)OECD members donated $4,333,135,732,679 between 1990 and 2013.
plot_aid <- df_country_aid_laws %>%
filter(year <= 2013) %>%
group_by(year) %>%
summarise(total = sum(total_oda)) %>%
mutate(fake_facet_title = "ODA commitments (all OECD)")
fig_oecd_aid <- ggplot(plot_aid, aes(x = year, y = (total / 1000000000))) +
geom_line(size = 0.5) +
labs(x = NULL, y = "Billions of USD") +
scale_y_continuous(labels = dollar) +
coord_cartesian(xlim = c(1990, 2015)) +
theme_donors() +
facet_wrap(vars(fake_facet_title))
fig_oecd_aid
df_donor %>%
filter(year >= 1990) %>%
group_by(purpose_contentiousness) %>%
summarise(Total = sum(oda)) %>%
ungroup() %>%
mutate(Percent = Total / sum(Total)) %>%
mutate(Total = dollar(Total),
Percent = percent_format(accuracy = 0.1)(Percent)) %>%
rename(`Contentiousness` = purpose_contentiousness) %>%
kbl() %>%
kable_styling(full_width = FALSE)| Contentiousness | Total | Percent |
|---|---|---|
| High | $267,373,936,986 | 6.2% |
| Low | $4,071,293,867,271 | 93.8% |
plot_aid_contentiousness <- df_donor %>%
filter(year >= 1990) %>%
group_by(year, purpose_contentiousness) %>%
summarise(total = sum(oda)) %>%
mutate(perc = total / sum(total)) %>%
filter(purpose_contentiousness == "High") %>%
mutate(fake_facet_title = "Contentious aid (all OECD)")
fig_oecd_contention <- ggplot(plot_aid_contentiousness, aes(x = year, y = perc)) +
geom_line(size = 0.5) +
scale_y_continuous(labels = percent_format(accuracy = 1)) +
labs(x = NULL, y = "Percent") +
coord_cartesian(xlim = c(1990, 2015)) +
theme_donors() +
facet_wrap(vars(fake_facet_title))
fig_oecd_contention
total_us_aid <- df_country_aid_laws %>%
summarise(total = dollar(sum(oda_us))) %>%
pull(total)
total_us_aid_post_2000 <- df_country_aid_laws %>%
filter(year > 1999) %>%
summarise(total = dollar(sum(oda_us))) %>%
pull(total)The US donated $370,908,545,608 between 1990 and 2014 and $247,285,957,589 between 2000 and 2014.
plot_aid_us <- df_country_aid_laws %>%
filter(year >= 1990) %>%
group_by(year) %>%
summarise(total = sum(oda_us)) %>%
mutate(fake_facet_title = "ODA commitments (USAID only)")
fig_us_aid <- ggplot(plot_aid_us, aes(x = year, y = (total / 1000000000))) +
geom_line(size = 0.5) +
expand_limits(y = 0) +
labs(x = NULL, y = "Billions of USD") +
scale_y_continuous(labels = dollar) +
coord_cartesian(xlim = c(1990, 2015)) +
theme_donors() +
facet_wrap(vars(fake_facet_title))
fig_us_aid
Total amounts over time:
usaid_total <- df_country_aid_laws %>%
summarise(total = sum(oda_us)) %>% pull(total)
channels_nice <- tribble(
~channel, ~channel_clean,
"oda_us_ngo_dom", "Domestic NGOs",
"oda_us_ngo_int", "International NGOs",
"oda_us_ngo_us", "US-based NGOs"
)
df_country_aid_laws %>%
pivot_longer(names_to = "channel", values_to = "total_oda_us",
c(oda_us_ngo_dom, oda_us_ngo_int, oda_us_ngo_us)) %>%
group_by(channel) %>%
summarise(total = sum(total_oda_us)) %>%
ungroup() %>%
left_join(channels_nice, by = "channel") %>%
mutate(perc = total / usaid_total) %>%
mutate(total = dollar(total), perc = percent(perc)) %>%
select(Channel = channel_clean, Total = total, Percent = perc) %>%
kbl() %>%
kable_styling(full_width = FALSE)| Channel | Total | Percent |
|---|---|---|
| Domestic NGOs | $6,244,919,475 | 1.7% |
| International NGOs | $13,172,644,690 | 3.6% |
| US-based NGOs | $28,751,784,246 | 7.8% |
The US clearly favors US-based NGOs or international NGOs over domestic NGOs.
usaid_total_yearly <- df_country_aid_laws %>%
group_by(year) %>%
summarise(annual_total = sum(oda_us)) %>%
mutate(fake_facet_title = "USAID ODA channeled through NGOs")
plot_usaid_channel <- df_country_aid_laws %>%
filter(year >= 1990) %>%
pivot_longer(names_to = "channel", values_to = "total_oda_us",
c(oda_us_ngo_dom, oda_us_ngo_int, oda_us_ngo_us)) %>%
group_by(year, channel) %>%
summarise(total = sum(total_oda_us)) %>%
left_join(usaid_total_yearly, by = "year") %>%
mutate(perc = total / annual_total) %>%
left_join(channels_nice, by = "channel")
fig_usaid_channel <- ggplot(plot_usaid_channel,
aes(x = year, y = perc, colour = channel_clean)) +
geom_line(size = 0.5) +
scale_y_continuous(labels = percent_format(accuracy = 1)) +
scale_colour_manual(values = channel_colors) +
labs(x = NULL, y = "Percent") +
guides(colour = guide_legend(title = NULL, reverse = TRUE, nrow = 2)) +
coord_cartesian(xlim = c(1990, 2015)) +
theme_donors() +
facet_wrap(vars(fake_facet_title))
fig_usaid_channel
USAID data categorizes all aid as government-channeled before 2000 because of some quirk in the data.
plot_usaid_channels_all <- df_donor_us %>%
group_by(year, channel_subcategory_name) %>%
summarise(total = sum(oda_us_2011)) %>%
mutate(perc = total / sum(total)) %>%
mutate(channel = ifelse(str_detect(channel_subcategory_name, "NGO"), "NGO", "Other"))
ggplot(plot_usaid_channels_all,
aes(x = year, y = perc, colour = channel_subcategory_name)) +
geom_line(size = 0.5) +
scale_y_continuous(labels = percent_format(accuracy = 1)) +
labs(x = NULL, y = "Percent of US aid given through different channels") +
guides(colour = guide_legend(title = NULL, ncol = 2)) +
theme_donors()
So we just look at aid after 2000.
fig_usaid_channel_trimmed <- fig_usaid_channel +
coord_cartesian(xlim = c(2000, 2015))
fig_usaid_channel_trimmed
fig_dvs <- (fig_oecd_aid + fig_oecd_contention) /
(fig_us_aid + fig_usaid_channel_trimmed) &
theme_donors(base_size = 10) +
theme(legend.text = element_text(size = rel(0.6)),
axis.title.y = element_text(margin = margin(r = 3)),
legend.box.margin = margin(t = -0.5, unit = "lines"))
fig_dvs
ggsave(here("analysis", "output", "fig-dvs.pdf"), fig_dvs,
width = 6.5, height = 4.75, device = cairo_pdf)
ggsave(here("analysis", "output", "fig-dvs.png"), fig_dvs,
width = 6.5, height = 4.75, dpi = 300, type = "cairo")ngo_index_table <- ngo_index_table %>%
mutate(Index_nice = paste0(Index, " (max: ", Max, ")"))
ngo_index_table %>%
select(`Restriction description` = Description, Coding) %>%
kbl(align = c("l", "l"),
caption = "Description of indexes of NGO barriers") %>%
kable_styling() %>%
pack_rows(index = table(fct_inorder(ngo_index_table$Index_nice)),
indent = FALSE)| Restriction description | Coding |
|---|---|
| Barriers to entry (max: 3) | |
| How burdensome is registration? | Not burdensome = 0; Burdensome = 1 |
| In law, can an NGO appeal if denied registration? | Yes = 0; No = 1 |
| Are barriers to entry different for NGOs receiving foreign funds? | Less burdensome = -1; Same = 0; More burdensome = 1 |
| Barriers to funding (max: 5) | |
| Do NGOs need prior approval from the government to receive foreign funding? | Yes = 1; No = 0 |
| Are NGOs required to channel foreign funding through state-owned banks or government ministries? | Yes = 1; No = 0 |
| Are any additional restrictions on foreign support in place? | Yes = 1; No = 0 |
| Are all NGOs prohibited from receiving foreign funds? | No = 0; Partially = 0.5; Yes = 1 |
| Is a category of NGOs prohibited from receiving foreign funds? | No = 0; Partially = 0.5; Yes = 1 |
| Barriers to advocacy (max: 2) | |
| Does the law restrict NGOs from engaging in political activities? | No = 0; Partially = 0.5; Yes = 1 |
| Are restrictions on political activities different for NGOs receiving foreign funds? | Less restrictive = -1; Same = 0; More restrictive = 1 |
regulations <- regulations %>%
filter(!ignore_in_index) %>%
mutate(barrier_group = paste0("Barriers to ", str_to_lower(barrier))) %>%
select(barrier_group, barrier = question_clean, barrier_display = question_display)
df_barriers <- df_country_aid_laws %>%
group_by(gwcode, year) %>%
summarize(across(one_of(regulations$barrier), ~. > 0)) %>%
group_by(year) %>%
summarize(across(-gwcode, ~sum(.))) %>%
ungroup() %>%
pivot_longer(names_to = "barrier", values_to = "value", -year) %>%
left_join(regulations, by = "barrier") %>%
mutate(barrier_display = str_replace(barrier_display, "XXX", "\n")) %>%
arrange(desc(value)) %>%
mutate(barrier_display = fct_inorder(barrier_display, ordered = TRUE))
dcjw_entry_plot <- ggplot(filter(df_barriers,
barrier_group == "Barriers to entry"),
aes(x = year, y = value,
color = barrier_display,
linetype = barrier_display)) +
geom_line(size = 0.5) +
expand_limits(y = c(0, 90)) +
scale_y_continuous(sec.axis = sec_axis(~ . / num_countries,
labels = percent_format(accuracy = 1)),
expand = c(0, 0)) +
scale_colour_manual(values = c("black", "grey80", "grey50"), name = NULL) +
scale_linetype_manual(values = c("solid", "solid", "21"), name = NULL) +
coord_cartesian(xlim = c(1990, 2015), ylim = c(0, 90)) +
guides(color = guide_legend(nrow = 2)) +
labs(x = NULL, y = "Number of countries") +
theme_donors(10) +
theme(legend.justification = "left") +
facet_wrap(vars(barrier_group))
dcjw_funding_plot <- ggplot(filter(df_barriers,
barrier_group == "Barriers to funding"),
aes(x = year, y = value,
color = barrier_display,
linetype = barrier_display)) +
geom_line(size = 0.5) +
scale_y_continuous(sec.axis = sec_axis(~ . / num_countries,
labels = percent_format(accuracy = 1)),
expand = c(0, 0)) +
scale_colour_manual(values = c("black", "grey80", "grey50", "black", "grey80"), name = NULL) +
scale_linetype_manual(values = c("solid", "solid", "solid", "21", "21"), name = NULL) +
coord_cartesian(xlim = c(1990, 2015), ylim = c(0, 40)) +
guides(color = guide_legend(nrow = 3),
linetype = guide_legend(nrow = 3)) +
labs(x = NULL, y = "Number of countries") +
theme_donors(10) +
theme(legend.justification = "left") +
facet_wrap(vars(barrier_group))
dcjw_advocacy_plot <- ggplot(filter(df_barriers,
barrier_group == "Barriers to advocacy"),
aes(x = year, y = value,
color = barrier_display)) +
geom_line(size = 0.5) +
scale_y_continuous(sec.axis = sec_axis(~ . / num_countries,
labels = percent_format(accuracy = 1)),
expand = c(0, 0)) +
scale_colour_manual(values = c("black", "grey80"), name = NULL) +
coord_cartesian(xlim = c(1990, 2015), ylim = c(0, 60)) +
guides(color = guide_legend(nrow = 1)) +
labs(x = NULL, y = "Number of countries") +
theme_donors(10) +
theme(legend.justification = "left") +
facet_wrap(vars(barrier_group))
df_ccsi_plot <- df_country_aid %>%
left_join(df_autocracies, by = "gwcode") %>%
group_by(year, autocracy) %>%
nest() %>%
mutate(cis = data %>% map(~ mean_cl_normal(.$v2xcs_ccsi))) %>%
unnest(cis) %>%
ungroup() %>%
mutate(fake_facet_title = "Core civil society index",
autocracy = factor(autocracy,
labels = c("Democracies (Regimes of the World > 4)",
"Non-democracies (Regimes of the World ≤ 4)"),
ordered = TRUE))
fig_ccsi <- ggplot(df_ccsi_plot, aes(x = year, y = y)) +
geom_ribbon(aes(ymin = ymin, ymax = ymax, fill = autocracy), alpha = 0.2) +
geom_line(aes(color = autocracy), size = 0.5) +
annotate(geom = "text", x = 2015, y = 0.1, hjust = "right", size = pts(7),
label = "Higher values = more open civil society") +
scale_colour_manual(values = c("black", "grey75"), name = NULL) +
scale_fill_manual(values = c("black", "grey75"), name = NULL) +
scale_linetype_manual(values = c("solid", "solid", "21")) +
coord_cartesian(xlim = c(1990, 2015), ylim = c(0, 1)) +
guides(color = guide_legend(nrow = 2)) +
labs(y = "Average", x = NULL) +
theme_donors(10) +
theme(legend.justification = "left") +
facet_wrap(vars(fake_facet_title))
barriers_summary <-
((dcjw_entry_plot + dcjw_funding_plot) /
(dcjw_advocacy_plot + fig_ccsi)) &
theme(legend.text = element_text(size = rel(0.6)),
axis.title.y = element_text(margin = margin(r = 3)),
legend.box.margin = margin(t = -0.5, unit = "lines"))
barriers_summary
ggsave(here("analysis", "output", "fig-barriers-summary.pdf"), barriers_summary,
width = 6.5, height = 6, device = cairo_pdf)
ggsave(here("analysis", "output", "fig-barriers-summary.png"), barriers_summary,
width = 6.5, height = 6, dpi = 300, type = "cairo")Laws requiring NGO registration aren’t necessarily a sign of oppression—even the US requires that nonprofits that earn above a certain threshold register as 501(c)(3) organizations. Though the figure below shows that compulsory regulation have increased over time, actual restriction has occurred too. Burdensome registration is not just another standard layer of bureaucracy.
df_regulation <- df_country_aid_laws %>%
left_join(select(df_autocracies, gwcode, autocracy), by = "gwcode") %>%
group_by(year, autocracy) %>%
summarise(`Registration required` = sum(ngo_register) / n(),
`Registration burdensome` = sum(ngo_register_burden) / n()) %>%
ungroup() %>%
pivot_longer(names_to = "type_of_law", values_to = "value", -c(year, autocracy)) %>%
mutate(autocracy =
factor(autocracy, levels = c(TRUE, FALSE),
labels = c("Non-democracies", "Democracies")))
fig_regulation_burden <- ggplot(df_regulation,
aes(x = year, y = value, color = type_of_law)) +
geom_line(size = 0.5) +
scale_y_continuous(labels = percent_format(accuracy = 1)) +
scale_x_continuous(expand = c(0, 0)) +
coord_cartesian(ylim = c(0, 0.7), xlim = c(1990, 2014)) +
guides(colour = guide_legend(title = NULL)) +
labs(x = NULL, y = "Proportion of countries\nwith regulation") +
theme_donors(10) +
facet_wrap(vars(autocracy))
fig_regulation_burden
ggsave(here("analysis", "output", "fig-regulation-burden.pdf"), fig_dvs,
width = 6, height = 2.5, device = cairo_pdf)
ggsave(here("analysis", "output", "fig-regulation-burden.png"), fig_dvs,
width = 6, height = 2.5, dpi = 300, type = "cairo")aid_donor_type_time <- df_donor %>%
group_by(year, donor_type_collapsed) %>%
summarise(total_aid = sum(oda, na.rm = TRUE))
ggplot(aid_donor_type_time, aes(x = year, y = total_aid / 1000000000,
colour = donor_type_collapsed)) +
geom_line(size = 0.5) +
labs(x = NULL, y = "Billions of USD",
caption = "Source: OECD and AidData. 2011 dollars.") +
guides(colour = guide_legend(title = NULL)) +
scale_y_continuous(labels = dollar) +
theme_donors()
aid_contention_time <- df_donor %>%
group_by(year, purpose_contentiousness) %>%
summarise(total_aid = sum(oda, na.rm = TRUE))
ggplot(aid_contention_time, aes(x = year, y = total_aid / 1000000000,
colour = purpose_contentiousness)) +
geom_line(size = 0.5) +
labs(x = NULL, y = "Billions of USD",
caption = "Source: OECD and AidData. 2011 dollars.") +
guides(colour = guide_legend(title = NULL)) +
scale_y_continuous(labels = dollar) +
theme_donors()
inv_logit <- function(f, a) {
a <- (1 - 2 * a)
(a * (1 + exp(f)) + (exp(f) - 1)) / (2 * a * (1 + exp(f)))
}
dvs_clean_names <- tribble(
~barrier, ~barrier_clean,
"barriers_total", "All barriers",
"advocacy", "Barriers to advocacy",
"entry", "Barriers to entry",
"funding", "Barriers to funding"
)
ivs_clean_names <- tribble(
~variable, ~variable_clean, ~hypothesis,
"total_oda_lead1", "Total ODA", "H1",
"prop_contentious_lead1", "Contentious aid", "H2",
"prop_ngo_dom_lead1", "Aid to domestic NGOs", "H3",
"prop_ngo_foreign_lead1", "Aid to foreign NGOs", "H3"
)df_plot_barriers_oda <- df_country_aid_laws %>%
select(year, gwcode, country, total_oda_lead1,
one_of(dvs_clean_names$barrier)) %>%
pivot_longer(names_to = "barrier", values_to = "value",
one_of(dvs_clean_names$barrier)) %>%
left_join(dvs_clean_names, by = "barrier") %>%
mutate(barrier_clean = fct_inorder(barrier_clean, ordered = TRUE))
ggplot(df_plot_barriers_oda,
aes(x = value, y = total_oda_lead1, color = barrier_clean)) +
geom_point(alpha = 0.5) +
stat_smooth(method = "lm") +
stat_smooth(data = filter(df_plot_barriers_oda,
total_oda_lead1 > 10000000000),
method = "lm", linetype = "21") +
scale_y_continuous(labels = dollar) +
guides(color = FALSE) +
labs(x = "Number of legal barriers", y = "Total ODA in next year",
title = "Total ODA in next year",
subtitle = "Dotted lines show trends when omitting observations\nwith less than $10,000,000,000 in ODA") +
theme_donors(10) +
theme(strip.text.x = element_text(margin = margin(t = 1, b = 1))) +
facet_wrap(vars(barrier_clean), scales = "free_x", nrow = 2)
df_plot_barriers_contention <- df_country_aid_laws %>%
select(year, gwcode, country, prop_contentious_lead1,
one_of(dvs_clean_names$barrier)) %>%
pivot_longer(names_to = "barrier", values_to = "value",
one_of(dvs_clean_names$barrier)) %>%
left_join(dvs_clean_names, by = "barrier") %>%
mutate(barrier_clean = fct_inorder(barrier_clean, ordered = TRUE))
ggplot(df_plot_barriers_contention,
aes(x = value, y = prop_contentious_lead1, color = barrier_clean)) +
geom_point(alpha = 0.5) +
stat_smooth(method = "lm") +
stat_smooth(data = filter(df_plot_barriers_contention,
prop_contentious_lead1 > 0.05),
method = "lm", linetype = "21") +
scale_y_continuous(labels = percent) +
guides(color = FALSE) +
labs(x = "Number of legal barriers",
y = "Proportion of contentious aid in next year",
title = "Proportion of contentious aid in next year",
subtitle = "Dotted lines show trends when omitting observations\nwith less than 5% contentious aid") +
theme_donors(10) +
theme(strip.text.x = element_text(margin = margin(t = 1, b = 1))) +
facet_wrap(vars(barrier_clean), scales = "free_x", nrow = 2)
df_plot_barriers_ngos <- df_country_aid_laws %>%
select(year, gwcode, country,
prop_ngo_dom_lead1, prop_ngo_foreign_lead1,
one_of(dvs_clean_names$barrier)) %>%
pivot_longer(names_to = "barrier", values_to = "value",
one_of(dvs_clean_names$barrier)) %>%
pivot_longer(names_to = "ngo_type", values_to = "prop_ngo",
c(prop_ngo_dom_lead1, prop_ngo_foreign_lead1)) %>%
left_join(dvs_clean_names, by = "barrier") %>%
left_join(ivs_clean_names, by = c("ngo_type" = "variable")) %>%
mutate(barrier_clean = fct_inorder(barrier_clean, ordered = TRUE))
ggplot(df_plot_barriers_ngos,
aes(x = value, y = prop_ngo, color = barrier_clean)) +
geom_point(alpha = 0.5) +
stat_smooth(method = "lm") +
stat_smooth(data = filter(df_plot_barriers_ngos,
prop_ngo > 0.05),
method = "lm", linetype = "21") +
scale_y_continuous(labels = percent) +
guides(color = FALSE) +
labs(x = "Number of legal barriers",
y = "Proportion of aid to NGOs in next year",
title = "Proportion of aid channeled to types of NGOs in next year",
subtitle = "Dotted lines show trends when omitting observations\nwith less than 5% aid to NGOs") +
coord_cartesian(ylim = c(0, 1)) +
theme_donors(10) +
theme(strip.text.x = element_text(margin = margin(t = 1, b = 1))) +
facet_wrap(vars(variable_clean, barrier_clean), scales = "free_x", ncol = 4)
df_plot_ccsi_ngos <- df_country_aid_laws %>%
select(year, gwcode, country,
one_of(ivs_clean_names$variable), v2xcs_ccsi) %>%
pivot_longer(names_to = "variable", values_to = "value",
c(one_of(ivs_clean_names$variable))) %>%
left_join(ivs_clean_names, by = "variable") %>%
mutate(hypothesis_clean = paste0(hypothesis, ": ", variable_clean)) %>%
arrange(hypothesis_clean) %>%
mutate(hypothesis_clean = fct_inorder(hypothesis_clean, ordered = TRUE))
ggplot(df_plot_ccsi_ngos,
aes(x = v2xcs_ccsi, y = value, color = hypothesis)) +
geom_point(alpha = 0.25) +
scale_color_viridis_d(option = "plasma", end = 0.9) +
guides(color = FALSE) +
labs(x = "Civil society index",
y = "Variable value in next year",
title = "Core civil society index") +
theme_donors() +
facet_wrap(vars(hypothesis_clean), scales = "free_y")
civicus_clean %>%
filter(!is.na(category)) %>%
count(Rating = category, name = "Count") %>%
arrange(desc(Rating)) %>%
kbl(align = c("l", "c")) %>%
kable_styling(full_width = FALSE)| Rating | Count |
|---|---|
| Open | 42 |
| Narrowed | 40 |
| Obstructed | 47 |
| Repressed | 44 |
| Closed | 23 |
plot_civicus_map <- ggplot() +
geom_sf(data = civicus_map_data, aes(fill = fct_rev(category)), size = 0.15, color = "black") +
coord_sf(crs = st_crs("ESRI:54030"), datum = NA) + # Robinson
# scale_fill_manual(values = c("grey90", "grey70", "grey45",
# "grey20", "black"),
# na.translate = FALSE, name = "Civic space") +
scale_fill_viridis_d(option = "plasma", end = 0.9,
na.translate = FALSE, name = "Civic space") +
theme_donors_map() +
theme(legend.position = "bottom",
legend.key.size = unit(0.7, "lines"))
plot_civicus_map
ggsave(here("analysis", "output", "fig-civicus-map.pdf"), plot_civicus_map,
width = 5.5, height = 3, device = cairo_pdf)
ggsave(here("analysis", "output", "fig-civicus-map.png"), plot_civicus_map,
width = 5.5, height = 3, dpi = 300, type = "cairo")ncol_countries <- 4
all_countries <- df_country_aid_laws %>%
distinct(country) %>%
arrange(country) %>%
pull(country)
countries_caption <- paste0("All countries included in models (N = ",
length(all_countries), ")")
all_countries %>%
matrix_from_vector(ncol = ncol_countries) %>%
kbl(caption = countries_caption) %>%
kable_styling(bootstrap_options = c("condensed", "striped"),
full_width = FALSE)| Afghanistan | Ecuador | Liberia | Saudi Arabia |
| Albania | Egypt | Libya | Senegal |
| Algeria | El Salvador | Lithuania | Serbia |
| Angola | Equatorial Guinea | Madagascar | Sierra Leone |
| Argentina | Eritrea | Malawi | Singapore |
| Armenia | Estonia | Malaysia | Slovakia |
| Azerbaijan | Eswatini | Mali | Slovenia |
| Bahrain | Ethiopia | Mauritania | Solomon Islands |
| Bangladesh | Fiji | Mauritius | Somalia |
| Belarus | Gabon | Mexico | South Africa |
| Benin | Gambia | Moldova | South Korea |
| Bhutan | Georgia | Mongolia | South Sudan |
| Bolivia | Ghana | Montenegro | Sri Lanka |
| Bosnia & Herzegovina | Guatemala | Morocco | Sudan |
| Botswana | Guinea | Mozambique | Syria |
| Brazil | Guinea-Bissau | Myanmar (Burma) | Tajikistan |
| Bulgaria | Guyana | Namibia | Tanzania |
| Burkina Faso | Haiti | Nepal | Thailand |
| Burundi | Honduras | Nicaragua | Timor-Leste |
| Cambodia | Hungary | Niger | Togo |
| Cameroon | India | Nigeria | Trinidad & Tobago |
| Central African Republic | Indonesia | North Korea | Tunisia |
| Chile | Iran | North Macedonia | Turkey |
| China | Iraq | Oman | Turkmenistan |
| Colombia | Israel | Pakistan | Uganda |
| Comoros | Jamaica | Panama | Ukraine |
| Congo - Brazzaville | Jordan | Papua New Guinea | United Arab Emirates |
| Congo - Kinshasa | Kazakhstan | Paraguay | Uruguay |
| Costa Rica | Kenya | Peru | Uzbekistan |
| Côte d’Ivoire | Kosovo | Philippines | Venezuela |
| Croatia | Kuwait | Poland | Vietnam |
| Cuba | Kyrgyzstan | Portugal | Yemen |
| Cyprus | Laos | Qatar | Zambia |
| Czechia | Latvia | Romania | Zimbabwe |
| Djibouti | Lebanon | Russia | |
| Dominican Republic | Lesotho | Rwanda |