Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Causal Inference

Explorations in causal inference using the potential outcomes (Rubin) framework, based on the Mixtape Sessions by Scott Cunningham.

Statistical Concepts

Potential Outcomes Framework (Rubin Causal Model)

For each individual i, there exist two potential outcomes:

  • Y_i(0): outcome under no treatment (control)
  • Y_i(1): outcome under treatment

The individual treatment effect (ITE) is delta_i = Y_i(1) - Y_i(0). The fundamental problem of causal inference is that we can never observe both potential outcomes for the same individual.

Aggregate Causal Parameters

  • ATE (Average Treatment Effect): E[Y(1) - Y(0)] -- the population-level average causal effect
  • ATT (Average Treatment Effect on the Treated): E[Y(1) - Y(0) | D=1]
  • ATU (Average Treatment Effect on the Untreated): E[Y(1) - Y(0) | D=0]

Selection Bias

The Simple Difference in Outcomes (SDO) between treated and untreated groups decomposes as:

SDO = ATE + Selection Bias + Heterogeneous Treatment Effect Bias

where:

  • Selection Bias = E[Y(0)|D=1] - E[Y(0)|D=0] (systematic differences in baseline outcomes)
  • HTE Bias = (1 - pi)(ATT - ATU) (difference in treatment effect between groups)

The Switching Equation

Realized outcomes follow: Y_i = (1 - D_i) * Y_i(0) + D_i * Y_i(1), where D_i is the treatment indicator.

Lab 1: Perfect Doctor vs. Random Assignment

Simulates 100,000 individuals with normally distributed potential outcomes (Y(0) ~ N(9.4, 4), Y(1) ~ N(10, 4)) and compares two assignment mechanisms:

  1. Perfect Doctor: assigns treatment only to individuals who would benefit (delta > 0). This introduces severe selection bias because the doctor uses information about potential outcomes.
  2. Random Assignment: assigns treatment to the first 50% of individuals. Eliminates selection bias by construction.

Key Results

Potential Outcomes Framework Analysis

Parameter Perfect Doctor Random Assignment
ATE ~0.60 ~0.60
ATT ~4.71 ~0.56
ATU ~-4.27 ~0.64
Selection Bias ~-4.50 ~0.05
SDO ~0.22 ~0.62

Under the perfect doctor, the SDO (0.22) is far from the true ATE (0.60) because of large selection bias. Under random assignment, the SDO closely approximates the true ATE.

Selection Bias: Perfect Doctor vs Random Assignment

Thornton Lab: HIV Testing and Financial Incentives

Replicates analysis from Thornton (2008) -- a randomized experiment in Malawi studying whether financial incentives increase the likelihood of learning HIV test results.

Key Results

Thornton HIV Experiment Analysis

  • Control group (no incentive): ~33.9% picked up HIV test results
  • Treatment group (any incentive): ~78.9% picked up HIV test results
  • Treatment effect: ~45 percentage points increase in pickup rate
  • The OLS coefficient on the incentive indicator is highly significant (p < 0.001)

This demonstrates that even small financial incentives can have a substantial effect on health-seeking behavior.

Notebooks