Install any skill in seconds. Free to start, no credit card required.
Get Started Free →brycewang-stanford/python-causality-guide
Learn causal inference with Python using the Brave and True handbook
Passed 23 of 23 test cases with the skill, and 22 of 23 without it.
1 fixed22 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
A test case the skill fixed. Same model, same prompt, with and without the skill.
Before specifying complex econometric regressions or matching pipelines on observational data, what primary exploratory analysis step should be conducted to inspect functional forms and potential overlap issues?
| Checked | Without skill | With skill |
|---|---|---|
| Graph and plot the data distributions visually before fitting estimators | Missed | Passed |
The instructions your model reads when the skill loads.
Causal Inference for the Brave and True is an open-source, Python-based textbook by Matheus Facure that teaches causal inference methods through practical implementations. The book bridges the gap between theoretical econometrics textbooks and hands-on data science practice, presenting each method with runnable Python code, real-world datasets, and intuitive explanations that demystify the mathematics behind causal reasoning.
The handbook covers the full spectrum of causal inference techniques used in modern empirical research, from foundational concepts like potential outcomes and directed acyclic graphs (DAGs) through advanced methods including instrumental variables, regression discontinuity, difference-in-differences, and synthetic control. Each chapter builds on the previous one, constructing a coherent framework for thinking about causation from observational data.
With over 3,000 GitHub stars, this resource has become a standard reference for graduate students, applied researchers, and data scientists seeking to add causal reasoning to their analytical toolkit. The emphasis on Python implementation makes it directly applicable to modern research workflows.
The handbook runs as Jupyter notebooks. Set up the environment:
git clone https://github.com/matheusfacure/python-causality-handbook.git
cd python-causality-handbook
# Create a virtual environment
python -m venv causal-env
source causal-env/bin/activate
# Install dependencies
pip install numpy pandas matplotlib seaborn scikit-learn statsmodels
pip install linearmodels causalinference
pip install jupyter
Launch the notebook server:
jupyter notebook
The chapters are organized as numbered Jupyter notebooks, starting from foundational concepts and progressing to advanced methods. Each notebook is self-contained with all data loading and analysis code included.
Potential Outcomes Framework: The book begins by establishing the Neyman-Rubin potential outcomes model, defining treatment effects and the fundamental problem of causal inference:
test cases passed, vs 22 / 23 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.