Skip to content

Latest commit

 

History

45 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Everyday Causal Inference — Data and code repository

Learn how to find causal answers to your everyday questions using R and Python.

About the book

At everydaycausal.com you will learn how to estimate, test, and explain causal impacts. You don't need any specific background to master the ideas there. Every concept is broken down step-by-step, with relatable examples from e-commerce, fintech, and digital businesses.

About this repository

You can read the book without running any code, but following along with the exercises is the best way to learn. To do that, you'll need R or Python installed.

Data

All datasets used in the book are available in the data folder. You can either:

  • Download manually from the folder above, or
  • Load directly in your code by passing the raw URL to read.csv() in R or pd.read_csv() in Python:
https://raw.githubusercontent.com/RobsonTigre/everyday-ci/main/data/<filename>.csv

Setup

To install every package used across the book's code examples in one go:

Python (tested with 3.9+; chapter 11's pycausalarima needs 3.10+ and is skipped automatically on older versions):

pip install -r requirements.txt

R:

Rscript install.R

or run source("install.R") from an R session. Each script also lists its own packages in a comment at the top, so you can install per chapter instead.

Companion AI plugin: Everyday Causal Skills

The book has an optional companion, everyday-causal-skills — a free plugin that gives your AI coding agent (Claude Code, Gemini CLI, GitHub Copilot CLI, Codex CLI, or Cursor) the workflow taught in the book: describe your causal question in plain language, get a method recommendation, check the assumptions, write the analysis in R or Python, stress-test the results, and compile a report.

You don't need it to follow the book. But if you want extra hands-on practice — for example, /causal-exercises generates practice problems with simulated data and known ground truth — head to the everyday-causal-skills repository for installation instructions and worked examples.

Contribute and stay updated

  • Star this repo to signal interest and get updates.
  • 🔔 Follow the author for weekly posts on causal inference.
  • 🌐 Contact: Reach me through my website or socials.
  • ✍️ Read more: Longer-form posts on Substack and Medium.
  • 📬 Subscribe to be notified when new content is released.
  • 🚩 Feedback: Found an error or have a suggestion? Submit feedback here.

Citation

If you use this material in your work, please cite:

Tigre, Robson. Everyday Causal Inference: How to estimate, test, and explain impacts with R and Python. https://www.everydaycausal.com/

Legal notice

Copyright © 2025 by Robson Tigre. All rights reserved. You are welcome to clone this repository, run the code and data for personal learning, and adapt the code for your own professional projects with attribution — but not to redistribute the material or use it to train AI systems. See LICENSE.md for the full terms and the legal notice for details.

About

R & Python code and datasets for Everyday Causal Inference — a free book on experiments, DiD, IV, RDD, and causal time series for business

Topics

Resources

Stars

138 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages