statable Statistics for study and research

Did the measure change anything? (difference-in-differences)

In brief

A measure hits one group (the treated), another it does not (the comparison group). Both are measured before and after. The change of the treated alone says little, because something changes over time even without the measure. The comparison group shows roughly how much. So the change of the comparison group is subtracted from the change of the treated: the difference of the differences (difference-in-differences). This holds only under one assumption: without the measure both groups would have moved in parallel (parallel trends). With one point in time before, it cannot be checked from the data, only argued.

An example with real data

321 house sales in North Andover (Massachusetts), 1978 and 1981, prices in 1978 dollars. Houses near a planned waste incinerator are compared with the others. The other houses rose on average from 82,517.23 to 101,307.51 (+18,790.29), the houses near the plant from 63,692.86 to 70,619.24 (+6,926.38). The difference-in-differences is −11,863.90: near the plant prices rose about 11,900 dollars less. The regression with interaction gives the same number, plus the standard error 7,456.65 (p = .113; robust 8,635.59, p = .170): that is not clearly different from zero. With area, rooms and age in the model it is −11,479.40 (standard error 5,302.66, p = .031; robust 6,237.81, p = .067). The statement stays uncertain.

When do I use it?

When a measure, a law, a plant or a programme hits only part of the cases and there are measurements before and after, for treated cases and for others. The comparison group must be similar to the treated one so that parallel trends are plausible.

Requirements

How it works in Statable

  1. Open Examples > "House prices and a waste incinerator (Kiel and McClain)" (economics) and run the regression "preis from nahe_anlage and nachher".
  2. Under the result, at "Calculate differently", open the block "Did the measure change anything? (difference-in-differences)" (Ctrl+K: "difference-in-differences"); outcome "preis", group column "nahe_anlage", time column "nachher", optionally add area, rooms and age; "Calculate difference-in-differences".

The first table shows the four means with the changes and the difference; the second the regression with classical and robust standard errors. The script for R can be saved.

Reading and reporting the result

Prices of the houses near the plant rose by 6,926 dollars from 1978 to 1981, those of the others by 18,790 dollars. The difference-in-differences was −11,864 dollars (SE = 7,457, p = .113; robust SE = 8,636).

Limits

What is often misunderstood

Sources

Wooldridge, J. M. Introductory Econometrics (difference-in-differences, dataset kielmc after Kiel & McClain 1995; data in the R package wooldridge, GPL). Cunningham, S. Causal Inference: The Mixtape, chapter Difference-in-Differences (mixtape.scunning.com, freely available). Huntington-Klein, N. The Effect, chapter Difference-in-Differences (theeffectbook.net, freely available). Own words, no exercise from a book.

Take away

  • The change of the comparison group shows what would have happened anyway without the measure; it is subtracted from the change of the treated.
  • The difference-in-differences holds only if both groups would have moved in parallel.
  • With one point in time before, this assumption cannot be checked, only argued.
  • A non-significant result means: the data are too uncertain, not: no effect.

Related

Open in Statable