ECON 410 · Econometrics II: Causal Methods and Time Series

Selection Bias and Matching

When you cannot flip a coin, you can compare treated people only with untreated people who look just like them.

Key takeaways

  • Selection bias appears when the people who get a treatment differ from those who do not in ways that also affect the outcome.
  • Matching compares each treated person with untreated people who share the same observed traits.
  • A propensity score squeezes many traits into one number: the chance of getting treated.
  • Matching works only where treated and untreated people overlap, and only if the traits you observe capture all the selection.
  • Hidden traits such as motivation can still bias the answer, and matching cannot fix that.

A city runs a job-training program, and 200 workers take it. Another 200 do not. A year later the trained workers earn less on average than the untrained ones. Should the city shut the program down?

Not so fast. Picture Lena, who runs the program. She notices that most trainees had only a high school diploma, while most non-trainees had college degrees. College graduates earn more, with or without a training course. The program may have helped every single trainee, yet the raw averages say it failed.

This lesson is about what to do when a coin flip is not available, as in randomized experiments, and people chose their own treatment. The tool is matching: comparing like with like. It is powerful, and it rests on an assumption you should learn to doubt.

Why raw comparisons mislead

Think back to potential outcomes. A raw comparison of trained and untrained workers estimates the real effect plus selection bias. Here the bias comes from education. The trained group is mostly high school graduates, who would have earned less anyway.

Economists call a trait that affects both who gets treated and the outcome a confounder. In Lena's city, education is a confounder: it pushes people toward training (those with less schooling sign up more) and it also raises earnings.

Lena's numbers

Suppose the 400 workers break down like this. All figures are invented for the lesson.

Who is in Lena's data
150 workers Average earnings $25,000 50 workers Average earnings $22,000 Trained Not trained 200 workers Training is common here 50 workers Average earnings $40,000 150 workers Average earnings $37,000 Trained Not trained 200 workers Training is rare here High school College 400 workers 200 trained, 200 not 400 workers 200 trained, 200 not High school: 200 workers Training is common here Trained: 150 workers Average earnings $25,000 Not trained: 50 workers Average earnings $22,000 College: 200 workers Training is rare here Trained: 50 workers Average earnings $40,000 Not trained: 150 workers Average earnings $37,000

Most trainees have a high school diploma; most non-trainees have college degrees.

First the raw comparison. The trained group's average earnings are a weighted blend of its two sub-groups.

Trained:     (150 × 25,000 + 50 × 40,000) ÷ 200
           = (3,750,000 + 2,000,000) ÷ 200 = 28,750
Not trained: (50 × 22,000 + 150 × 37,000) ÷ 200
           = (1,100,000 + 5,550,000) ÷ 200 = 33,250
Raw gap:     28,750 − 33,250 = −4,500

The raw gap says training cuts earnings by $4,500. Now compare like with like.

High school workers: 25,000 − 22,000 = +3,000
College workers:     40,000 − 37,000 = +3,000

Inside each education group, training adds $3,000. Weight the groups by how many trainees each has: 150 of 200 are high school (75%) and 50 of 200 are college (25%). So 0.75 × 3,000 + 0.25 × 3,000 = $3,000. The program raises earnings by $3,000 for the kind of people who actually took it.

The raw answer was off by $7,500 and had the wrong sign. The culprit was a composition effect: the trained group is full of lower-earning people, so its average looks low.

Why the raw gap is negative
True effect of training $3,000 Education mix ($7,500) Raw gap ($4,500) True effect of training $3,000 Education mix ($7,500) Raw gap ($4,500)

Trainees have less schooling, which pulls their average down by $7,500 and hides a real gain of $3,000. Example with made-up numbers.

How matching works

The recipe is easy to say. For each treated person, find untreated people who look the same on the traits that matter, then compare. In Lena's data the only trait is education, so we can match exactly. High school trainees are compared with high school non-trainees, and the same for college.

Real data has many traits at once: age, education, past earnings, city, family size. Exact matching on all of them would leave almost nobody to compare. So economists use shortcuts.

  • Nearest-neighbor matching pairs each treated person with the untreated person who is closest on the measured traits.
  • Stratifying puts people in bins, such as by age and education, and compares inside each bin, which is what we did above.
  • Regression adjustment puts the traits into a regression as controls, which choosing which variables to include discusses.

All of these share one idea: hold the observed traits fixed, then compare.

One match, step by step

Here is nearest-neighbor matching on a single trait, last year's earnings, with invented people. Omar took the training. Last year he earned $20,000, and a year after training he earns $26,000. Three untreated workers are available as matches.

Worker Last year's earnings Earnings a year later Distance from Omar
Pia 19,000 22,500 1,000
Quinn 31,000 35,000 11,000
Raj 20,500 23,000 500

Raj is closest, so he becomes Omar's stand-in. The estimated effect for Omar is 26,000 − 23,000 = $3,000. Repeat this for every trainee and average the results. That average estimates the effect of the program on people like the trainees.

Notice what the match avoids. Comparing Omar with Quinn would be unfair, since Quinn earned far more before the program and would likely earn more after it regardless. Comparing him with the average of all three untreated workers would mix in the same problem. That average is about $26,833, which would make the program look like it cost Omar roughly $833 instead of helping him by $3,000. Matching tells you whom to ignore as much as whom to use.

Also notice the weakness. One close match is thin evidence. Raj may have had a lucky year. That is why studies use many matches per person and report standard errors, just as in an experiment.

The propensity score

Matching on ten traits at once is awkward. In the 1980s, the statisticians Paul Rosenbaum and Donald Rubin showed a neat shortcut. Compress all the traits into one number, the propensity score: the probability that a person with those traits gets treated. Then match people who have the same score.

In Lena's data the score is easy to see. For high school workers, 150 of 200 trained, so the score is 150 ÷ 200 = 0.75. For college workers, 50 of 200 trained, so the score is 0.25. People with the same score have the same odds of being treated, and the idea is that among them, who actually got treated is as good as random.

In real work the score is estimated from data using a regression that predicts treatment from the traits. The result is a number between 0 and 1 for each person. You then compare treated and untreated people with similar scores.

The two promises you must check

Matching comes with two conditions. Both are worth stating plainly.

Overlap. There must be untreated people who resemble the treated ones. Imagine that nobody with a college degree ever took training. Then a college trainee has no match, and you cannot say what her untreated outcome would be. The common support is the range of scores where both treated and untreated people exist. Estimates are only trustworthy inside it. Good studies show the overlap in a graph of the two groups' scores and drop people outside the shared range.

No hidden confounders. This is the big one. Matching works only if the traits you observed capture everything that drives both treatment and outcome. The assumption has several names, such as selection on observables or conditional independence. In words: once you account for what you can see, who got treated looks like chance.

Suppose Lena's trainees are also the most determined workers, and determination raises earnings. She never measured determination. Then even matched workers differ on a hidden trait, and some bias remains. No test on your data can prove the hidden confounder is absent. You can only argue for it with knowledge of how people got into treatment.

What matching can and cannot do
Matching can fix Differences in education, age or past earnings Unequal mixes of groups, as in Lena's data Comparisons made across very different people Matching cannot fix Unmeasured traits such as determination or health Cases with no similar untreated people Choices driven by something you never recorded VS Matching can fix Differences in education, age or past earnings Unequal mixes of groups, as in Lena's data Comparisons made across very different people Matching cannot fix Unmeasured traits such as determination or health Cases with no similar untreated people Choices driven by something you never recorded

Matching removes bias you can see and leaves bias you cannot.

A common mistake: controlling for the wrong things

More controls are not always better. Suppose Lena also matched workers on their income after training. That trait is partly caused by the training itself, so matching on it would erase part of the effect she wants to measure. Match on traits from before the treatment. A good rule: only use things that were already fixed when people decided whether to enroll.

A second mistake is treating a matched estimate as if it came from an experiment. A famous paper by Robert LaLonde in 1986 tested this using a job-training program that had been run as a real randomized experiment. He then tried standard non-experimental methods on the same program, comparing trainees with people drawn from surveys. Many of those estimates missed the experimental answer, sometimes by a lot. Later work showed that careful matching, with rich pre-program data, can do better, but the lesson stuck: a clean experiment is the benchmark, and non-experimental methods have to earn trust.

If you suspect a hidden confounder, other designs may help. The next lesson, instrumental variables, looks for outside nudges that shift treatment without being tied to the hidden trait.

Words to know

Selection bias a gap between groups, present even without treatment, caused by who ended up treated.

Confounder a trait that affects both who gets treated and the outcome, and so distorts a simple comparison.

Matching comparing each treated person with untreated people who share the same observed traits.

Propensity score the probability that a person with a given set of traits gets the treatment.

Common support the range of traits or scores in which both treated and untreated people are found.

Selection on observables the assumption that the traits you measured capture all the reasons people differ in treatment and outcome.

Composition effect a gap in averages caused by groups having different mixes of people, not by any real effect.

Check yourself

  1. Why can a program that helps every participant still look harmful in a raw comparison?
  2. In Lena's data, what is the propensity score of a college worker, and how did you get it?
  3. In a similar city, trainees are 60% high school and 40% college. The training effect is $2,000 for high school workers and $5,000 for college workers. What is the average effect on trainees?
  4. Why does matching need overlap between treated and untreated people?
  5. Explain why matching on income measured after training would be a mistake.
  6. Lena's trainees were also more determined, which she did not measure. What does that do to the matched estimate, and why can she not test for it?
Show the answers
  1. The participants may differ from non-participants in ways that lower earnings anyway, so the raw averages mix that gap in with the true gain.
  2. 50 of the 200 college workers were trained, so the score is 50 ÷ 200 = 0.25.
  3. 0.60 × 2,000 + 0.40 × 5,000 = 1,200 + 2,000 = $3,200.
  4. With no similar untreated people, you cannot know what a treated person's outcome would have been without treatment, so there is nothing fair to compare.
  5. Post-training income is partly caused by the training, so matching on it would remove some of the effect you are trying to measure.
  6. The matched estimate would still be biased, probably upward, because trainees differ on an unmeasured trait; the data contain no information about it, so no test can rule it out.

A free self-study program written for 4Economics with AI writing tools and not reviewed line by line by a person. It is not an accredited degree and awards no credit. Check anything you rely on against a textbook or primary source. Report an error.

In this unit: Causal designs

  1. The Potential Outcomes FrameworkEvery cause-and-effect claim compares two worlds, but we only ever see one; this is how economists say that precisely.11 min
  2. Randomized ExperimentsFlipping a coin to decide who gets a treatment is the cleanest way to learn what the treatment really does.10 min
  3. Selection Bias and MatchingWhen you cannot flip a coin, you can compare treated people only with untreated people who look just like them.10 min
  4. Instrumental VariablesAn instrument is an outside nudge that shifts who gets treated without touching the outcome any other way.9 min
  5. Two-Stage Least Squares and Weak InstrumentsTwo-stage least squares scales instrument ideas to real data, and a weak first stage can quietly wreck the answer.9 min
  6. Panel Data and Fixed EffectsFollowing the same units over time lets you cancel out every unchanging difference between them.9 min
  7. Difference-in-DifferencesCompare how a treated group changed with how a similar untreated group changed, and the gap in changes is the effect.10 min
  8. Regression DiscontinuityWhen a rule hands out a benefit at a sharp cutoff, people just above and just below it make a natural experiment.10 min
  9. Synthetic ControlBuild a weighted "twin" of one treated place from untreated places, then read the gap after the policy as its effect.11 min

In the news