Quick recap
The key takeaways of every lesson on one page. Read it in ten minutes to refresh the whole track; open a lesson when a point feels unclear.
01 Correlation vs causation
- An association ( depends on ) can come from causation, reverse causation, a common cause (confounding), selection on a common effect (collider, Berkson), or chance. One scatter plot cannot tell them apart.
- A confounder causes both the treatment and the outcome. In , the pooled slope is ; adjusting for gives .
- A pooled rate is a weighted average of the group rates, , with weights given by the case mix.
- Simpson's paradox: a comparison has one direction in every group and the opposite direction pooled. It needs a different case mix in the compared groups.
- In the kidney-stone data A wins for small (93.1% vs 86.7%) and large stones (73.0% vs 68.8%), B wins pooled (82.6% vs 78.0%); standardized to the same stone mix, A wins (83.3% vs 77.9%).
- The data cannot tell which table to trust. If the grouping variable is a cause of the treatment (confounder), use the groups; if it is caused by the treatment (mediator), use the pooled data.
- Pearl's ladder: association , intervention , counterfactual . Higher rungs need more than data from lower rungs.
02 Potential outcomes and experiments
- Each unit has potential outcomes and ; the individual effect is . Estimands: ATE , ATT (given ), ATC (given ), CATE .
- Fundamental problem of causal inference: we observe only , so is never observed. Causal inference is a missing-data problem.
- SUTVA = consistency (a well-defined treatment; ) + no interference between units.
- Naive difference ATT selection bias . Tutoring example: .
- Under consistency, exchangeability and positivity, . Randomization makes exchangeability true by design.
- Under complete randomization the difference in means is unbiased for the ATE, with variance ; the usual estimate drops the last term and is conservative.
- Fisher's randomization test assumes the sharp null for all , fills the table with the observed outcomes, and gives an exact p-value over all possible assignments.
- Blocking and regression adjustment on pre-treatment covariates reduce variance; never adjust for post-treatment variables. Check sample-ratio mismatch and interference in A/B tests.
03 Causal graphs and d-separation
- A structural causal model assigns each variable from its parents and an independent noise, ; its causal graph is a DAG with an arrow from each parent to its child.
- A missing arrow claims no direct effect, and a missing common cause claims no unmeasured confounding; these claims are what make a graph testable.
- Markov factorization: ; equivalently, each node is independent of its non-descendants given its parents.
- Chain and fork: dependent, but independent given the middle node. Collider: independent, but dependent given the collider or any of its descendants.
- A path is blocked by if it has a non-collider in or a collider with neither itself nor a descendant in ; d-separation means every path is blocked.
- Global Markov property: d-separation implies conditional independence in every distribution that factorizes over the graph; faithfulness (the converse) is an extra assumption that fails when paths cancel.
- Selecting data on a common effect (admission, survival, approval) is conditioning on a collider and creates associations that do not exist in the population (Berkson's paradox, M-bias).
04 The do-operator and adjustment
- replaces the assignment of by the constant and removes the arrows into ; in general .
- Truncated factorization: at ; and .
- A causal quantity is identified if every SCM with the graph and the same observational distribution gives the same value; identification needs positivity.
- Backdoor criterion: has no descendant of and blocks every path from to that starts with an arrow into ; then .
- Good controls: confounders (remove bias) and causes of only (reduce variance). Bad controls: mediators, colliders, descendants of , M-bias nodes; instruments add variance and amplify bias.
- Frontdoor: if carries all of the effect, has no open backdoor path from , and its backdoor paths to are blocked by , then .
- Do-calculus has three rules (insert/delete observations, exchange action and observation, insert/delete actions); it is complete, so an effect the rules cannot identify is not identified by any method without new assumptions.
05 Matching and propensity scores
- Under consistency, conditional exchangeability and positivity , the ATE is identified by the g-formula ; regression, matching and weighting are different estimators of this one estimand.
- Outcome regression predicts both potential outcomes for every unit; with heterogeneous effects, the single OLS coefficient of is a variance-weighted average of effects, not the ATE.
- Nearest-neighbor matching of treated units estimates the ATT; a caliper drops unmatched units and changes the estimand; imperfect matches cause bias that grows with the number of covariates.
- The propensity score balances : , and exchangeability given implies exchangeability given . Judge its model by balance (), not by AUC.
- IPW weights treated units by and controls by (ATT: controls by ); it is importance sampling, unbiased with the true , and the Hájek (normalized) form is preferred.
- Extreme weights come from poor overlap; check the largest weight and the effective sample size ; trimming lowers the variance but changes the estimand.
- AIPW is consistent if either the outcome model or the propensity model is correct; its bias is a product of the two errors.
- No adjustment removes an unmeasured confounder; report how strong one would need to be: omitted-variable bias , the robustness value, or the E-value .
06 Instrumental variables
- An instrument satisfies relevance ( moves ), exclusion ( changes only through ) and independence ( is as good as random). Only relevance can be tested.
- In a linear model, . For binary this is the Wald estimator: reduced form divided by first stage.
- With noncompliance, the units are compliers, always-takers, never-takers and defiers. The first stage equals the share of compliers when there are no defiers.
- Under independence, exclusion, relevance and monotonicity (no defiers), the Wald ratio equals the LATE: the average effect for compliers, not the ATE.
- With one-sided noncompliance (no one can get the treatment without ), the LATE equals the effect on the treated.
- 2SLS: . Residuals for the standard error must use the real , not .
- A weak instrument (small first-stage ) pulls 2SLS towards OLS, gives heavy tails and intervals that cover the truth too rarely; is a minimum, not a guarantee.
07 RDD, DiD and synthetic control
- A sharp RDD identifies , the effect at the cutoff, if the potential-outcome regressions are continuous at .
- Estimate the RDD jump with local linear regression on each side (triangular kernel, bandwidth ); a larger lowers variance and raises bias. Avoid high-order global polynomials.
- RDD checks: no bunching of the running variable at the cutoff, no jumps in pre-treatment covariates, no jumps at placebo cutoffs. A fuzzy RDD is IV at the cutoff: jump in divided by jump in .
- Two-period DiD: identifies the ATT under parallel trends in , no anticipation and no spillovers.
- Card and Krueger (1994): New Jersey , Pennsylvania , DiD FTE per store (2.76 in the paper).
- An event study estimates one DiD per period; flat pre-period coefficients support parallel trends but cannot prove it for the post-period.
- With staggered adoption and effects that change over time, TWFE uses already-treated units as controls and can put negative weights on effects; use group-time estimators.
- Synthetic control: a convex combination of donors fitted on the pre-period; the post-period gap estimates the effect, and placebo-in-space tests give inference.
08 Causal ML
- The CATE equals under consistency, conditional exchangeability and positivity; ML helps estimate it but cannot fix a missing confounder.
- Meta-learners turn any regression method into a CATE estimator: the S-learner shrinks effects toward 0, the T-learner is noisy when one group is small, the X-learner uses the large group's model, the DR-learner regresses AIPW pseudo-outcomes.
- Double ML for : cross-fit and , then (residual on residual, the FWL idea).
- Neyman orthogonality makes nuisance errors enter only as products; cross-fitting removes the bias from overfitting. Rate condition: .
- With heterogeneous effects, the partially linear is an average weighted by ; AIPW with cross-fitting is the DML estimator of the ATE.
- Honest causal trees choose splits on one subsample and estimate leaf effects on another; causal forests average them and give confidence intervals for .
- Individual effects are never observed: evaluate CATE models on randomized held-out data with the transformed outcome (), uplift or Qini curves, and group average effects.
09 Counterfactuals and mediation
- A counterfactual is the value of in the modified model for a unit with background ; it is about the observed units, while is about the population.
- Counterfactuals are computed in three steps: abduction (), action (replace the equation of by ), prediction (run with the posterior noise).
- Rung 3 is not identified by rungs 1–2: and give the same experiments but opposite counterfactuals; extra assumptions or bounds are needed.
- Probability of necessity ; under exogeneity , and under monotonicity .
- Mediation: , , ; fixes the mediator for everybody.
- In a linear model with interaction : and ; the product of coefficients is right only when .
- Natural effects are identified by the mediation formula under no unmeasured –, –, – confounding and the untestable cross-world assumption; randomizing is not enough.
- Counterfactual fairness asks whether a decision would change if the protected attribute and its descendants changed; counterfactual explanations of a classifier are not causal, and recourse needs an SCM of the features.
10 Causal discovery
- Causal discovery needs causal Markov, faithfulness, causal sufficiency and acyclicity; then the conditional independences of the data are exactly the d-separations of the true graph.
- Two DAGs are Markov equivalent (same independences) if and only if they have the same skeleton and the same v-structures (Verma and Pearl 1990); on 3 nodes, 25 DAGs fall into 11 classes.
- A CPDAG draws a class: arrows are shared by every DAG in the class, lines can point either way; observational independences cannot orient the lines.
- PC removes edges with tests on growing conditioning sets, orients when is not in the separating set of , and applies Meek's rules; with correct tests it returns the CPDAG.
- On data, PC treats "not rejected" as independent: controls sparsity, and one wrong test propagates to other edges.
- NOTEARS replaces the search over DAGs by the smooth constraint , which holds exactly for acyclic graphs; on simulated data, check for varsortability by standardizing.
- Non-Gaussian noise (LiNGAM) or nonlinear additive noise breaks the symmetry: only in the causal direction is the residual independent of the regressor.
- An intervention on a node orients every edge at that node; single-node experiments always suffice.
11 Causality in ML practice
- A predictor trained by minimizing loss on one distribution uses every predictive association there, including spurious ones; more data from the same source does not remove them. Report worst-group accuracy.
- A distribution shift is an intervention on one mechanism of the SCM: covariate shift ( changes, fixed) is natural when ; label shift ( changes, fixed) is natural when .
- Under label shift, : the old classifier can be corrected without new labels.
- The causal parents of give the same in every environment that does not intervene on ; ICP returns the intersection of invariant sets and covers with probability .
- IRM, group DRO, reweighting, last-layer retraining and augmentation fight spurious features; careful ERM is a strong baseline, and IRM needs many environments.
- Logged data are selected by the old policy; decisions need effects (uplift), not risk scores.
- Off-policy evaluation: is unbiased with logged propensities and overlap; SNIPS normalizes the weights; DR adds a reward model and stays unbiased if either part is right.
- Large importance weights mean a small effective sample size and noisy estimates; exploration in the logging policy is the real fix.