Causal Inference in R (for people who prefer code over maths)
A series of blog posts explaining key causal inference concepts and methodologies in my own words, with lots of R code examples, visualisations and memes. Low-key aimed towards people like me, who find these ideas easier to grasp with code/algorithms and simulations rather than with math notation.
-
Introduction to causal diagrams (DAGs) (available in Spanish)
-
Potential Outcomes Model (or why correlation is not causality) (available in Spanish)
-
Randomization Inference in R: a better way to compute p-values in randomized experiments (available in Spanish)
-
Matching in R (I): Subclassification, Common Support and the Curse of Dimensionality
-
Matching in R (II): Differences between Matching and Regression
-
Matching in R (III): Propensity score, Weighting and the Double Robust Estimator
Work in progress, more posts to come…
Largely based on these excellent books:
-
Causal Inference: The Mixtape, by Scott Cunningham
-
Causal Inference for The Brave and True, by Matheus Facure
-
The Effect, by Nick Huntington-Klein