Observational Study Codexery

Difference in differences

Quasi-experimental method comparing treatment and control group changes over time.

Difference in differences (DID or DD) is a quasi-experimental statistical technique used in econometrics and quantitative research in the social sciences. It attempts to mimic an experimental research design using observational study data by studying the differential effect of a treatment on a treatment group versus a control group in a natural experiment. The method calculates the effect of a treatment on an outcome by comparing the average change over time in the outcome variable for the treatment group to the average change over time for the control group.

Assumptions

Difference-in-differences, as a version of ordinary least squares, inherits all of that model's Gauss-Markov assumptions. It also adds a requirement called the parallel trend assumption, which holds that both groups would have followed the same trajectory in the absence of treatment. If the formal model perfectly matches reality, this assumption is automatically satisfied, though a model allowing for different trends is often more plausible. To make the parallel trend assumption more credible, DID is frequently paired with matching. This technique pairs actual treatment units with simulated control units that are similar in key characteristics but never received treatment. By using the change in the outcome over time and matching units with comparable pre-treatment histories, the resulting average treatment effect for the treated becomes a more robust estimate. This approach serves two goals: it makes the parallel trend assumption more likely given the pre-treatment covariates, and it lessens reliance on certain ignorability assumptions. A key weakness of DID arises when some other factor changes in only one group at the same time as the treatment, breaking the parallel trend assumption. For the estimate to be accurate, the composition of both groups must stay constant over time. Analysts must also address issues like autocorrelation and Ashenfelter dips.

Implementation

The DID method can be implemented according to a table where the lower right cell is the DID estimator. Running a regression analysis gives the same result. Consider the OLS model where a dummy variable for the period equals 1 in the after period, and a dummy variable for group membership equals 1 for the treatment group. The composite variable is a dummy indicating when both conditions hold. This is a proper parametrization of the model formal definition, and the group and period averages relate to the model parameter estimates as follows: the estimate for the after period is the conditional average for the after period in the control group, the estimate for the treatment group is the conditional average for the treatment group in the before period, and the estimate for the interaction is the difference in differences. The estimate for the after period is an estimate of the counterfactual rather than the impact of the control group, as the control group is often used as a proxy for the counterfactual. The estimate for the treatment group can be interpreted as the impact of both the control group and the intervention's counterfactual. Due to the parallel trend assumption, this estimate is also the same differential between the treatment and control group in the after period. A first time difference of the outcome variable eliminates the need for the time trend to form an unbiased estimate, implying that estimate is not actually conditional on the treatment or control group. A difference among the treatment and control groups would eliminate the need for treatment differentials to form an unbiased estimate. This nuance is important when weak violations of parallel pre-trend exist or in cases of violations of appropriate counterfactual approximation assumptions.

Example

One of the most famous applications of the difference-in-differences method is a 1994 study on New Jersey's minimum wage. Researchers compared fast-food employment in New Jersey and Pennsylvania at two points: February 1992, before the wage rose, and November 1992, after it increased from $4.25 to $5.05 in April. Simply looking at employment changes only in New Jersey would miss factors like weather or regional economic shifts. By using Pennsylvania as a control group, the method automatically accounts for any unobserved variables that affected both states equally. The key assumption is that employment trends in the two states would have moved in parallel; if so, Pennsylvania's actual change shows what would have happened in New Jersey without the wage hike. The results contradicted some economic predictions: the minimum wage increase did not cause job losses. Instead, the analysis estimated that the $0.80 raise led to an average gain of 2.75 full-time equivalent employees per store. This work later contributed to the researcher receiving the 2021 Nobel Memorial Prize in Economic Sciences. A software command for this method is available in Stata as -diff-.

Applications

The difference-in-differences method is now used in many fields beyond its original focus on labor economics and minimum wage studies. In public health, researchers apply it to assess new medical guidelines or vaccination drives by looking at changes in different regions before and after a policy takes effect. In education, it helps measure the impact of reforms like altered school funding or class sizes. Environmental economists use it to evaluate pollution controls, energy use rules, or climate policies. All these uses depend on the assumption that the groups being compared would have followed similar trends without the intervention, but when set up carefully, the method can give policymakers strong causal estimates from observational data.

The approach also appears in economic history, where scholars treat past events as natural experiments to study long-term outcomes. In 2021, Elena Esposito used it to explore how malaria's arrival affected the spread of African slavery in the United States. She compared counties that were more or less ecologically suited for malaria transmission, before and after the disease became established in the late 1600s. Malaria-prone counties saw a much larger rise in the share of enslaved Africans once the disease was endemic. In 2017, González, Marshall, and Naidu applied the method to Maryland's 1864 uncompensated abolition of slavery. By combining census data with credit reports, they compared business formation by slaveowners and non-slaveowners before and after emancipation. Slaveowners were more likely to start businesses before abolition, but that advantage vanished afterward.

More in Observational Study

Spotted an error? Know more?

Reader corrections go straight into our review queue. Suggest an edit · How this site is sourced

Comments

Loading…
Open in the interactive codex →