Causal work in nonnprofit studies

library(tidyverse)
library(targets)
library(here)

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

invisible(list2env(tar_read(graphic_functions), .GlobalEnv))

articles <- read_csv(here("data", "manual_data", "Skimming notes_coding.csv"))
nvsq_counts <- read_csv(here("data", "manual_data", "nvsq_counts.csv"))
nvsq_counts_year <- nvsq_counts |>
  filter(Year <= 2020) |>
  group_by(Year) |>
  summarize(total = sum(Count))

plot_data <- articles |>
  filter(year <= 2020) |>
  count(year) |>
  left_join(nvsq_counts_year, by = c("year" = "Year")) |>
  mutate(pct = n / total)

ggplot(plot_data, aes(x = factor(year), y = pct)) +
  geom_col(fill = clrs$Prism[9]) +
  labs(
    x = NULL,
    y = "Percent of NVSQ articles",
    title = "Proportion of causally-focused\narticles in NVSQ, 2010–2020",
    caption = "Article uses an experiment, difference-in-differences, regression discontinuity,\ninstrumental variables, or other method for statistically identifying a causal mechanism\n\n(Voluntas, NML, PAR, JPART, JPAM, and PMR forthcoming)"
  ) +
  scale_y_continuous(labels = scales::percent_format(accuracy = 1)) +
  theme_np() +
  theme(panel.grid.major.x = element_blank())