Beyond Averages: Discovering Who Benefits from Religion?

Day 2: Advanced Methods in Causal Inference

Author
Affiliation

Joseph Bulbulia

Victoria University of Wellington, New Zealand

ImportantVenue

Date: Tuesday, 12 August 2025, 09:00 – 17:00
Location: Seventh College, 15th Floor Meeting Rooms
Building: Tower West, Building 1
Located on the northwest end of campus.

SPARCC Day 2

Beyond Averages: Heterogeneous Treatment Effects

Tuesday, 12 August 2025 | 09:00 – 17:00

Page Contents

On this page you’ll find:

  • Technical Setup - R, RStudio, and package installation
  • Workshop Agenda - Detailed schedule and learning goals
  • Workshop Objectives - What you’ll learn and prerequisites
  • Workshop Presentations - Case study PDFs (ATE and CATE)
  • Reference Materials - Links to glossary and DAGs

Quick links: Setup | Agenda | Presentations

Install R and R Studio

Visit the r archive network (cran) at https://cran.r-project.org/ Select the version of r suitable for your operating system (windows, mac, or linux) Download and install it.

Then install RStudio: https://www.rstudio.com/products/rstudio/download/ Choose the free version of rstudio desktop,

Then install the workshop package. The margot package is optional.

# Needed for installation
if (!requireNamespace("devtools", quietly = TRUE)) {
  install.packages("devtools")
}

# Simulations and analysis
devtools::install_github("go-bayes/causalworkshop")

# Install margot for advanced workflows
# warning, this package is being refactored: for demonstration purposes only.
devtools::install_github("go-bayes/margot")
# explanations
devtools::install_github("go-bayes/boilerplate")

This will install causalworkshop along with all required dependencies.

After installation, verify everything works:

# load the package
library(causalworkshop)

# check prerequisites
check_workshop_prerequisites()

Next run get_workshop_scripts() to get the scripts. Run them in order.

library(causalworkshop)

# copy workshop scripts to a working directory
# default will create a directory called `workshop-scripts`
get_workshop_scripts()

# you can set a different path, e.g.
# get_workshop_scripts("different-directory-name")


# see what scripts are available
list_workshop_scripts()

# or if you placed them in a directory other thna the default `workshop-scripts` directory
list_workshop_scripts("different-directory-name")


# Work through the scripts in order
# 01-baseline-adjustment.R    - Generate data
# 02-causal-forest-analysis.R - Simple causal forest
# 03-rate-qini-curves.R       -  Evaluate heterogeneity using RATE metrics
# 04-policy-trees.R           - Decision rules
# 05-margot-workflow.R        - Better Data Viz

:::

Agenda

Table 1: Workshop Schedule
Time Session Learning Goals & Activities
09:00–09:15 Recap of Day 1 Potential Outcomes and Average Treatment Effect: Review of (Day 1)
09:15–09:45 How to Ask a Causal Question Goal: Understand why causal questions in the scientific study of religion require a structured approach: Stating your causal question precisely (and what can go wrong if you don't). Example: Does religious service attendance increase charitable giving?
09:45–10:00 How to Answer a Causal Question Goal: Overview of the workflow steps: state question, state target population, check assumptions (with experts), data, estimation, sensitivity analysis, communicate to audience Illustration: *Which* causal effect of religious service?
10:00–10:30 Activity & Workflow Mapping Activity: Formulate a precise causal question. Following this, select one question and map it through the key workflow steps, identifying potential challenges at each stage.
10:30–10:45 Morning Tea
10:45–11:30 Beyond Averages: Conditional Average Treatment Effects (CATEs) Goal: Introduction to effect heterogeneity. Activity: Identify potential effect modifiers of religion β†’ Donations, Volunteering
11:30–12:30 Why Time-Series Data Are Tricky Goal: Describe why sequential exposures/time-varying exposures (such as causal mediation) is hard . Activity: Imagine cases where the confounder of a mediator might also be affected by the exposure.
12:30–13:30 Lunch
13:30–14:15 Bias in Data: A Structural Approach to Measurement Error Goal: How to use causal diagrams to investigate structural sources of bias Activity: Whiteboard session using graphs to illustrate measurement error (and bias correction).
14:15–15:00 Worked Example: Who does Religious Attendance Affect? Goal: Hands-on demonstration using causal forests to discover subgroups in the religious attendance-prosociality relationship. Activity: Live walkthrough using NZAVS analysis
15:00–15:15 Afternoon Tea
15:15–16:00 Group Exercise: Interpreting Heterogeneous Treatment Effects Goal: Develop skills in translating causal forest results into actionable insights for stakeholders (academic, government, religious groups, etc.). Activity: Teams analyse policy graphs showing which groups show strongest religion-charity, discuss implications.
16:00–16:45 Workflow Synthesis: Your Research Questions Goal: Clarify complete workflows for participants' own research questions about the social consequences of religion. Activity: Participants map their questions through each workflow stage.
16:45–17:00 Wrap-up & Resources Goal: Review: What have we learnt? Activity: Q&A, What Next? Brainstorm next steps: how might we work together?

Workshop Objectives

What You’ll Learn

By the end of this workshop, you will be able to:

  1. Formulate clear causal questions about the social consequences of religion

  2. Apply the causal inference workflow from question formulation through to communication of results.

  3. Understand Effect Modification and distinguish it from Moderation

  4. Identify and address common pitfalls in causal inference with longitudinal data, including time-varying confounding and measurement error.

  5. Understand modern machine learning methods (such as causal forests) to discover both average and heterogenious causal effects in religion \(\to\) prosociality relationships

  6. Understand how to translate causal findings into meaningful insights for diverse stakeholders (government, institutional leaders, religious communities)

  7. Apply insights to your flagship SPARCC Proposal.

TipPrerequisites
  • Basic familiarity with R and regression analysis (someone on your team)
  • Expertise in the scientific study of religion
  • No prior knowledge of causal inference required beyond SPARCC Day 1
NoteWhat to Bring
  • Laptop.
  • Download R, Rstudio, and the workshop package (as per the above instructions.)
TipReference Materials
Note

PDF Compatibility Note: These presentations work best in Safari. Chrome users may experience issues with the PDF preview - if so, please use the β€œOpen in New Tab” links for the best viewing experience.

Case Study 1: ATE

Case Study 2: CATE


Β© 2025 Joseph Bulbulia. This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.