Matching & Stratification
P8.causal-methods.02 · Audience: Guest, IT/ML learner, Language professional · Prerequisites: Confounders & Causal Diagrams
Where next?
Later in Causal Methods
This module unlocks
P8.causal-methods.02 · Audience: Guest, IT/ML learner, Language professional · Prerequisites: Confounders & Causal Diagrams
Later in Causal Methods
This module unlocks
The previous module diagnosed the disease — a confounder opens a backdoor path and can flip a result's sign — and hinted at the cure: read the effect within each stratum. This module turns that hint into a working method. Matching and stratification are two faces of one idea: instead of hoping the treated and control groups are comparable, force the comparison to be like-with-like by hand. We will match a toy cohort exactly, watch a confounded estimate shrink to its honest value, and end on the method's hard limit — the confounder you did not measure.
Randomization works because the coin flip, applied to a big enough group, hands the treated and control arms populations that look alike in every respect — measured or not — so any outcome gap must be the treatment. Observational data denies you the coin. Matching is the manual substitute: for each treated unit, find control units that look the same on the confounders, and compare only those. You are rebuilding, by hand, the balance the coin would have given you.
Why it matters — Comparing the raw treated average to the raw control average answers the wrong question when the groups differ to begin with — you measure the treatment plus every way the groups were already unalike. Matching restricts the comparison to look-alike units, so the confounder is held roughly constant across the comparison and the outcome gap is attributable to treatment instead.
The catch that shapes everything below: you can only match on what you have measured. Matching balances the columns in your table. Randomization balances the columns you never thought to record. That gap is the last step of this module.
This series recalls Confounders & Causal Diagrams and Matching & Stratification, with two questions from the earlier lessons.
Self-check
In a causal diagram, a variable that two arrows point into, a shared result of two separate causes, is called what?
Self-check
Instead of matching on twenty columns, an analyst sums up each person's columns as one number: their estimated chance of receiving the treatment. What is that number called?
Self-check
In a diagram, a route from T to Y that begins with an arrow pointing into T, for example through a shared cause, is called what?
Self-check
A library runs a reading club and records how many books people borrow. Keen readers joined the club far more often. Which comparison gives a fairer estimate of what the club does?
Self-check
A study asks whether tutoring (T) raises test scores (Y). Parents' education affects both who signs up and the scores. Homework time goes up because of tutoring and then lifts scores. What should be adjusted for?
Self-check
A translation tool's new interface lifts usage sharply in its first week, then the lift shrinks every week after. Which pitfall does this pattern point to?
Self-check
An analyst splits customers into young and old, finds the effect of a discount inside each group, and then combines the two. What should set the weight each group gets?
Self-check
A selective school admits pupils with top grades or a strong sports record. Among its pupils, the best athletes tend to have lower grades, so a researcher concludes that sport harms schoolwork. What went wrong?
Self-check
A team matched treated and untreated patients carefully on age, sex and weight, and writes: our matched estimate is as reliable as a randomized trial. What is wrong?
Self-check
With ten million users, a test shows a lift of a hundredth of a point that is clearly significant. The manager says: significant, so worth shipping. What is the flaw?
Practise this lesson's 10 self-checks
One per screen: 10 checked on this page, 0 you reveal and mark yourself. Nothing is recorded.
Ask a question about this content. The mentor explains and grounds its answer in what you are studying; asking is recorded as a learning signal, not a grade.
Off by default. The mentor always gets your file; this only decides whether your own copy stays here. Copies live in this browser only - they do not follow you to another device, and clearing site data removes them.
A scratch console for this page's ideas — ungraded, nothing you run here is recorded.
Scratch console
A scratch console with the scientific stack (pandas, numpy, scikit-learn). Runs on the server — no network, resource-limited and measured.
Output appears here.
Loading your notes...