Causal Designs, Agent-Driven
12
Potential Outcomes and Randomized Experiments
Causal Inference with AI Agents
Preface
The Agentic Research Desk
1
The PI and the Agent
2
Setting Up Claude Code and Codex for Research
3
Giving Agents Econometric Tools: MCP, Skills and Plugins
4
Your First Agent Session
Directing and Checking an Agent
5
Writing a Research Brief an Agent Can Follow
6
Reading What the Agent Did
7
Trust but Verify: Cross-Checking Against Stata and R
8
The Garden of Forking Paths at Machine Speed
Regression with an Agent
9
Linear Regression and Inference
10
Panel Data and Fixed Effects
11
Beyond Linear: Limited Dependent Variables and Time Series
Causal Designs, Agent-Driven
12
Potential Outcomes and Randomized Experiments
13
Causal Graphs: DAGs, Confounders and Colliders
14
Bad Controls and Selection Bias
15
Matching and Weighting
16
Instrumental Variables
17
Regression Discontinuity
18
Difference-in-Differences
19
Staggered Adoption and Event Studies
20
Synthetic Control
Machine Learning, Heterogeneity and Time-Varying Treatments
21
Double/Debiased Machine Learning
22
Heterogeneous Effects and Causal Forests
23
Time-Varying Treatments and G-Methods
From Estimate to Paper, with Agents
24
Sensitivity and Robustness, Audited
25
Tables, Figures and the Replication Package
26
Writing the Paper with Skills
27
Research Crews: Multiple Agents, One PI
28
Evaluating Research Agents
Appendices
A
Stata, R, StatsPAI and MCP Translation Table
B
Datasets Used in This Book
C
Prompt, Brief and Project Instruction Templates
D
StatsPAI MCP Tool Reference
Table of contents
12.1
The question: does learning your HIV status change behaviour?
12.2
The identifying assumption: random assignment
12.3
Doing it by hand: the difference in means and its standard error
12.4
Asking the agent: sp.ttest and sp.regress
12.5
Reading the agent’s work: balance tables and the unit of randomization
12.6
Where agents go wrong: controlling for post-treatment variables
12.7
Checklist
Edit this page
Report an issue
Causal Designs, Agent-Driven
12
Potential Outcomes and Randomized Experiments
12
Potential Outcomes and Randomized Experiments
Note
Planned for this chapter
Data:
thornton_hiv
Functions:
sp.ttest
,
sp.regress
,
sp.power_ttest
Starting material:
What If ch. 1-3, notebook 03
12.1
The question: does learning your HIV status change behaviour?
12.2
The identifying assumption: random assignment
12.3
Doing it by hand: the difference in means and its standard error
12.4
Asking the agent: sp.ttest and sp.regress
12.5
Reading the agent’s work: balance tables and the unit of randomization
12.6
Where agents go wrong: controlling for post-treatment variables
12.7
Checklist
Causal Designs, Agent-Driven
13
Causal Graphs: DAGs, Confounders and Colliders