Verified page

Causal Inference in Action: Understanding Impact with R

Instructor: Edzai Zvobwo

Date: June 17, 2025

Tags: Causal Inference, DAGs, R, Data Science, Policy Evaluation

About This Presentation

Causal inference is the science of answering the most powerful questions in data analysis such as:


If I do A what will happen to B? (Intervention)


What would have happened if we had done something differently? (Counterfactual)


This presentation equips learners, policymakers, and analysts with the foundations of causal reasoning, framed around a real-world South African case study.


Presentation

Download the Presentation

Key Topics Covered

Causality answers the question: “What would have happened if we had done something differently?”
Unlike correlation, causality identifies true cause-and-effect relationships rather than just associations.

Correlation can be misleading due to spurious relationships. For example, ice cream sales and drowning rates both rise in summer—but one doesn’t cause the other. Causal inference helps separate signal from noise.

Pioneers include:

Judea Pearl (Turing Award) – causal graphs and the Ladder of Causation

Angrist & Imbens (Nobel Prize) – natural experiments

Rubin, Heckman – foundational work in econometrics and program evaluation

It’s used in public policy (e.g., education, labor), health (e.g., vaccine effectiveness), and courtrooms (e.g., discrimination cases). Businesses like Meta, Spotify, and Google use it to personalize experiences and optimize systems.

Developed by Judea Pearl, it has three levels:

Association – seeing patterns

Intervention – doing something and measuring the effect

Counterfactuals – asking “what if something different had happened?”

We can never observe both outcomes (treated and untreated) for the same individual. This is called the Fundamental Problem of Causal Inference. To solve it, we use study designs, statistical techniques, and assumptions.

Key assumptions include:

Ignorability: no unmeasured confounding

SUTVA: one person’s outcome is unaffected by another’s treatment

Positivity: everyone has a chance of receiving each treatment

Consistency: observed outcomes match theoretical ones

Define a clear causal question

Draw a DAG to map assumptions

Identify confounders and adjustment sets

Choose an estimation method (e.g., matching)

Estimate the causal effect

Test robustness with sensitivity analysis

Interpret and communicate your findings

We simulate a digital skills training for unemployed youth in Alexandra, SA. Using R and causal methods, we evaluate whether the training improves employment outcomes after 6 months.

Using Propensity Score Matching, we balance treated and untreated groups, then estimate the Average Treatment Effect (ATE) to quantify program impact.

R Tools Featured

Goal: Does a digital skills training program improve employment outcomes?


Using simulated data and DAG logic, we identify confounders and estimate the Average Treatment Effect (ATE) using R.


`MatchIt` – Matching and causal balance checking

`dagitty`, `ggdag` – DAG creation and visualization

`grf` – Generalized random forests

Top R Packages

CausalInvestData – Real-World Datasets & Templates Use case: Practice causal inference with curated datasets and R/Quarto notebooks.

Highlights: Templates for PSM, DAGs, IV, DML, and counterfactual analysis; tailored for African use cases and development impact projects.
causalimpact – Bayesian Structural Time Series Use case: Estimating causal effects in time-series data (e.g., before–after interventions).

Highlights: Developed by Google; intuitive for marketing, policy, and web analytics use.
dagitty – DAG-Based Causal Analysis Use case: Creating, visualizing, and analyzing causal diagrams (DAGs).

Highlights: Built-in bias detection, adjustment set identification, and an intuitive GUI.
MatchIt – Propensity Score Matching Use case: Matching treated and control groups for covariate balance.

Highlights: Supports exact matching, nearest neighbor, Mahalanobis distance, and more.
twang – Toolkit for Weighting and Analysis of Nonequivalent Groups Use case: Propensity score weighting via generalized boosted models (GBM).

Highlights: Commonly used in health policy and educational interventions.
ivreg – Instrumental Variables Regression Use case: Estimating causal effects when there is endogeneity.

Highlights: Part of the AER package (Applied Econometrics with R).
causaldrf – Doubly Robust Estimation Use case: Supports estimation of treatment effects with continuous treatments.

Highlights: Implements DR estimators under the generalized propensity score framework.
ggdag – DAG Visualization with ggplot2 Use case: Visualize DAGs with modern plots and analytical overlays.

Highlights: Visualize adjustment sets, colliders, and backdoor paths.

Other Resources

Join the Causal Data Science Meeting 2025
CRAN Task View: Causal Inference
R-Bloggers: An introduction to Causal inference
Book: Fundamentals of Causal Inference With R
Brady Neal - Introduction to Causal Inference

You Can

Download - Causal Inference in R by Ana Daglis
Contact Us
Share with your family and friends
Verified page
Powered By Acalytica
Share
Download the Presentation
View
Book: Fundamentals of Causal Inference With R
View
Download - Causal Inference in R by Ana Daglis
View
Contact Us
Share with your family and friends