Difference in Differences Method Explained
Difference in Differences Method Explained
Executive Summary
The central pillar of the DiD design is the Parallel Trends Assumption. This assumption
posits that, in the absence of treatment, the average outcomes for the treatment and control
groups would have followed parallel paths over time [2, 4]. The validity of this assumption is
paramount to the credibility of the DiD estimator. While this assumption cannot be definitively
proven, its plausibility is assessed through rigorous diagnostics, including visual inspection,
event study analysis, and placebo tests [4, 5, 6].
In essence, the evolution of DiD from a simple algebraic formula to a complex econometric
framework reflects the ongoing effort to fortify causal inference against subtle biases. When
implemented with a deep understanding of its assumptions and a commitment to rigorous
diagnostic checks, DiD remains a robust and powerful tool for estimating the causal impact of
policies and events in a non-experimental context.
1. The Foundation of Causal Inference: A Quasi-
Experimental Design
The fundamental challenge in estimating causal effects from observational data is addressing
potential biases. A simple comparison of outcomes between a treated group and an
untreated control group in the post-intervention period can be misleading due to selection
bias—the two groups may have been different from the outset, leading to a difference in
outcomes that is not caused by the treatment [3, 6]. Similarly, a simple before-and-after
comparison for a single group can be flawed if other time-varying factors, or secular trends,
also influence the outcome [6].
DiD elegantly addresses both of these issues simultaneously. It operates on a simple but
powerful principle: the control group, which does not receive the treatment, serves as a
counterfactual for the treatment group, representing what would have happened to the
treated units in the absence of the intervention [4, 11]. By observing both groups over time,
DiD removes biases resulting from permanent, time-invariant differences between the
groups, as well as biases from comparisons over time in the treatment group that could be a
result of other, concurrent factors [2].
The method requires data on outcomes for both a treatment and a control group, at a
minimum of two time periods: at least one before the treatment and one after [3, 6]. The
approach relies on panel data, which consists of repeated observations of the same
individuals or groups over time, or repeated cross-sectional data, which involves surveying a
different sample of individuals from the same groups at different points in time [2].
1.2 The Two-by-Two Canonical Design and Formula
The most basic and intuitive form of DiD is the canonical two-group, two-period design. In
this setup, an outcome variable Y is measured for a treatment group T and a control group C
at two time points, one Before and one After an intervention.
The DiD estimator is calculated as the "difference of two differences" [7]. The first difference
captures the change in the outcome for the treatment group, and the second difference
captures the change for the control group [6]. The final DiD estimate is the difference
between these two changes.
DiD=(YT,After−YT,Before)−(YC,After−YC,Before)
where:
● YT,After is the outcome for the treatment group after the intervention.
● YT,Before is the outcome for the treatment group before the intervention.
● YC,After is the outcome for the control group after the intervention.
● YC,Before is the outcome for the control group before the intervention.
The user notes provide a simple numerical example to illustrate this calculation. If the average
wage in State A (treatment) increases from 10 to 13 (a change of +3), while the average wage
in State B (control) increases from 9 to 10 (a change of +1), the DiD estimate is calculated as:
DiD=(13−10)−(10−9)=3−1=2
In this example, the causal effect of the intervention on wages is estimated to be 2. While this
formula provides a clear and straightforward estimate, its simplicity can mask the underlying
assumptions and complexities of the real world. A more robust and flexible approach for
empirical research is to use a regression framework, which allows for the inclusion of control
variables and the estimation of standard errors.
For most empirical applications, DiD is implemented using a regression model on panel or
repeated cross-sectional data. This approach is more flexible than the simple algebraic
formula, as it can accommodate multiple time periods and control for other confounding
variables.
Yit=α+β⋅Treati+γ⋅Postt+δ⋅(Treati×Postt)+εit
Where:
● Yit is the outcome for individual i at time t.
● Treati is a binary dummy variable that equals 1 if the individual is in the treatment group
and 0 otherwise. This variable does not have a time subscript because group
membership is time-invariant [1].
● Postt is a binary dummy variable that equals 1 for the post-intervention period and 0 for
the pre-intervention period. This variable does not have an individual subscript because
the time period is constant across groups [1].
● (Treati×Postt) is the interaction term between the treatment group and the post-period.
This is the key term of the model, and its coefficient, δ, is the DiD estimator [2].
● εit is the error term.
From this table, the DiD estimator can be derived algebraically by subtracting the change in
the control group from the change in the treatment group:
The credibility of any DiD analysis rests squarely on its most critical identifying assumption:
the Parallel Trends Assumption [2]. This assumption dictates that in the absence of the
treatment, the average outcomes for the treatment group and the control group would have
followed identical trends over time [2, 4]. In a well-designed DiD study, the control group acts
as a valid proxy for the unobservable counterfactual, representing what would have
happened to the treatment group had they not been exposed to the intervention [4].
The challenge with the Parallel Trends Assumption is that it is fundamentally unfalsifiable [2].
The counterfactual scenario, where the treatment group does not receive the treatment, is by
definition not observed. Therefore, researchers cannot definitively prove that the two groups
would have followed the same trend in the absence of the intervention. Instead, researchers
must provide compelling evidence of the plausibility of the assumption. The strength of this
evidence depends heavily on the research design, the context of the study, and the rigor of
the diagnostic checks performed [3]. The ability to demonstrate that the assumption holds
for a period prior to the treatment lends credibility to the idea that it would have continued to
hold in the post-treatment period [6].
A violation of the Parallel Trends Assumption is the "Achilles' heel" of the DiD design, as it can
lead to severely biased estimates of the causal effect [3]. When the assumption is violated,
the DiD estimate no longer isolates the treatment effect alone [2, 4]. Instead, it captures a
combination of the true treatment effect and the underlying, divergent trends between the
groups [4]. This can result in estimates that are either positively or negatively biased,
depending on the direction of the divergence, leading to incorrect conclusions about the
impact of the intervention [4].
The presence of these issues highlights the need for researchers to move beyond simple
visual checks and employ more rigorous statistical methods to assess the validity of their
designs.
3. Assessing and Validating the Parallel Trends
Assumption
Given that the Parallel Trends Assumption is unfalsifiable, a crucial part of any credible DiD
analysis is providing evidence for its plausibility. Researchers use a combination of visual and
statistical methods to do this.
The most intuitive first step in assessing the Parallel Trends Assumption is to visually inspect
the data [2, 4]. This involves plotting the average outcome of both the treatment and control
groups over time, with a clear vertical line marking the intervention date. If the plots show
that the trends for both groups are visibly parallel in the pre-treatment period, it provides
initial support for the assumption [3, 4].
A more formal statistical method for assessing parallel trends is to run a regression on the
pre-treatment data only. The regression model for this check is:
Yit=α+β⋅Treati+γ⋅t+δ⋅(Treati×t)+εit
Where t represents a continuous time variable, or a series of time-period dummies. The key is
to test the null hypothesis H0:δ=0 against the alternative hypothesis H1:δ=0 [User Notes]. If
the coefficient δ is statistically insignificant, it implies that the pre-treatment trends for the
two groups were not statistically different, which supports the Parallel Trends Assumption. A
significant δ, on the other hand, indicates that the groups were already diverging before the
treatment, which is a strong sign of a violation [User Notes].
This type of pre-trend regression is conceptually similar to a Chow test, which is a statistical
test used to determine if the coefficients in two different linear regressions are equal [13]. In a
DiD context, a Chow test can be used to check if the pre-treatment trends in the treatment
and control groups were identical. The test essentially checks for a "structural break" in the
data at the time of the intervention [User Notes].
The event study specification is arguably the most powerful and widely used diagnostic tool
for assessing parallel trends [5]. It is an extension of the simple pre-trend regression that
provides a more granular look at the dynamics around the treatment date. The model involves
creating a series of dummy variables that represent the number of periods before and after
the treatment [5].
Ygt=α+k=T0∑−2βk×treatgk+k=0∑T1βk×treatgk+XstΓ+ϕs+γt+ϵgt
Here, treatgk is a dummy variable that is 1 if group g is k periods from its treatment date. The
pre-treatment period immediately before the intervention (lag -1) is typically omitted to serve
as the reference period [5].
The core of the event study is to examine the coefficients for the pre-treatment leads (βk for
k<0). For the Parallel Trends Assumption to be credible, these coefficients should be
statistically insignificant and hover closely around zero [5]. A graphical representation of the
coefficients and their confidence intervals provides compelling visual evidence.
The interpretation of the event study plot is a critical component of expert analysis.
For example, using data on the effects of no-fault divorce reforms on female suicide rates in
the U.S. [5], an event study would plot the estimated effect for each year relative to the
reform. If the years leading up to the reform show no significant change, it supports the
validity of the DiD analysis [5].
Placebo tests are a powerful form of robustness check that directly assess the potential for
biases unrelated to the treatment [6]. The logic is simple: if the analysis is repeated in a
scenario where no treatment effect is expected, and a non-zero effect is still found, it
suggests that the original DiD estimate may be compromised by confounding factors [4, 6].
Placebo tests are highly valuable because they directly probe for the presence of unobserved
confounders or selection biases. The ability to demonstrate a zero effect where none should
exist provides strong empirical support for the credibility of the primary DiD result [6].
While DiD is a powerful tool, its application in real-world settings often exposes limitations
that are not apparent in the simple canonical model. A nuanced understanding of these
advanced biases is essential for conducting credible causal inference.
The standard two-by-two DiD model assumes that all units in the treatment group are treated
at the same time. However, in many policy evaluations, treatment adoption is staggered
across time [5, 7]. For example, states might adopt a new law or policy at different years [5,
14]. In such staggered treatment designs, the standard two-way fixed-effects (TWFE)
regression estimator can produce biased estimates, particularly in the presence of
heterogeneous treatment effects, where the effect varies across units or over time [8].
The source of this bias is that the standard TWFE model implicitly uses already-treated units
as a "comparison" group for later-treated units [8]. If the effect of the treatment is not the
same for all groups, this "contamination" of the comparison group can lead to misleading
results, potentially even producing an estimate with the wrong sign [7, 8].
This methodological challenge has led to a new wave of econometric research focused on
developing more robust estimators for staggered treatment designs. These solutions, such as
those proposed by Sun and Abraham [15, 16] and Callaway and Sant'Anna [15], address the
bias by estimating cohort-specific effects (for units treated at the same time) and then
aggregating them into an overall estimate [16]. This "forward-engineering" approach ensures
that the estimator recovers a meaningful causal parameter under explicit assumptions,
avoiding the pitfalls of a simple regression-based approach [7].
Anticipation effects pose a significant threat to the validity of the Parallel Trends Assumption.
This bias occurs when individuals or entities change their behavior in anticipation of a
treatment that has been publicly announced but not yet implemented [4]. The underlying
mechanism for this is rooted in human cognition, where the expectation of a future event can
influence current behavior and decision-making [17]. For example, a business may hire fewer
employees or alter its prices in the months leading up to a new minimum wage law, as a result
of its managers anticipating the coming change in labor costs [18].
When anticipation effects are present, the treatment group's outcome trend will begin to
diverge from the control group's trend before the formal treatment date [4]. This divergence
directly violates the Parallel Trends Assumption. A critical diagnostic step in any DiD analysis,
therefore, is to conduct an event study analysis [5]. If the pre-treatment coefficients on the
event study plot are statistically significant and non-zero, it serves as direct evidence of
anticipation effects. In such cases, the standard DiD estimate is unreliable, as it is conflating
the true treatment effect with the pre-existing, expectation-driven changes [5].
The presence of anticipation effects suggests that for any publicly known policy change, an
event study is not merely a robustness check but a mandatory diagnostic. The existence of a
significant pre-treatment lead coefficient is not a sign that the statistical test has failed, but
rather that a real-world behavioral phenomenon is occurring, which must be acknowledged
and addressed as a limitation of the study.
4.3 Spillover Effects and the Stable Unit Treatment Value Assumption
(SUTVA)
A core assumption of causal inference is the Stable Unit Treatment Value Assumption
(SUTVA). SUTVA posits that a unit's outcome is solely a function of its own treatment status
and is not affected by the treatment status of other units [19]. Spillover effects are a direct
violation of this assumption, as they occur when the treatment of one unit indirectly affects
the outcomes of other, untreated units [19, 20].
For example, a job training program in one community may cause a spillover effect on a
neighboring, untreated community if the newly trained workers migrate and compete for jobs
there [19]. In a DiD framework, if the control group is affected by the treatment of the
treatment group, it can no longer serve as a valid counterfactual, leading to a biased DiD
estimate [19, 20]. The true effect on the treated group may be underestimated, as the
change in the control group's outcome is also a result of the intervention.
Addressing spillovers requires relaxing SUTVA and employing more complex methods, such
as inverse probability weighting, which redefine the estimand to account for the interference
between units [19, 20]. The presence of spillovers implies that simply ignoring them is only
acceptable in very specific scenarios, and researchers must be deliberate in their
assumptions about how treatment and control units interact. This pushes the DiD framework
from a simple two-group comparison to a more complex network-based analysis [20].
A significant strength of the DiD method is its ability to mitigate time-invariant selection
bias, which arises from inherent, permanent differences between the treatment and control
groups [3]. By focusing on the differential change over time, DiD effectively controls for these
baseline differences [11].
However, DiD does not eliminate all forms of selection bias. The method is still susceptible to
several other biases that can compromise the validity of the results:
● Reverse Causality: This bias occurs when the outcome trend itself influences the
allocation of the treatment [2, 11]. For example, a new education policy might be
implemented in school districts that were already experiencing a decline in test scores.
In this case, the treatment is not haphazardly assigned but is instead a response to the
pre-existing outcome trend, violating the core assumption of DiD [11].
● Time-Varying Selection Bias: If the composition of the treatment or control groups
changes over time (e.g., individuals dropping out or joining the study), it can introduce
bias [2]. This is particularly problematic in repeated cross-sectional designs where
different individuals are sampled in each period.
● Other Cognitive Biases: As noted in the broader literature, the design and
interpretation of a study can be affected by cognitive biases [21]. Confirmation bias
can lead researchers to subconsciously favor evidence that supports their initial
hypothesis [21]. Survivorship bias occurs when the analysis focuses only on data points
that have "survived" a selection process, ignoring those that did not [21]. For instance, in
a study on a business policy, if the analysis only includes firms that survived the policy
change, it could miss a negative effect on firms that went out of business as a result [21].
The following table provides a summary of these key biases and their potential mitigation
strategies.
Reverse Causality The outcome trend Violates the Use a placebo test
influences the assumption that with an outcome
allocation of the treatment is variable that would
treatment. unrelated to not cause
baseline outcome treatment
trends. allocation [6].
The limitations of the canonical DiD model have spurred the development of more advanced
methods that build on its core logic or offer alternative approaches to causal inference in
observational settings.
5.1 The Triple Difference (DiDiD) Estimator: Differencing Out the Bias
The Triple Difference (DiDiD or DDD) estimator is a powerful extension of the DiD method that
adds a third difference to remove a second source of bias [9]. The core idea is to find a
second, auxiliary group that is subject to the same time-varying confounding factor as the
primary treatment and control groups but is not affected by the treatment itself. The DiDiD
estimator is then calculated as the difference between two DiD estimates: one for the primary
treatment and control groups, and another for the auxiliary groups.
The underlying principle is that as long as the time-varying bias is the same for both pairs of
groups, it will be "differenced out" in the final calculation [9]. The most significant advantage
of this method is that it does not require two parallel trends assumptions [9]. Instead, it
requires only that the difference between the two pairs of groups would have followed a
parallel trend in the absence of treatment, which is a less stringent assumption [9]. The sole
purpose of subtracting the second DiD estimate is to remove the bias present in the first.
SDID builds on this by using optimally chosen weights for both units and time periods [10].
This flexibility allows it to "considerably loosen" the strict Parallel Trends Assumption of
standard DiD [10]. Unlike standard DiD, which can fail if the assumption is not met in the
aggregate data, SDID can handle cases where treated and control units are trending on
entirely different levels prior to the intervention [10]. SDID is a "particularly flexible modelling
option" that avoids the limitations of both DiD and SC, such as SC's requirement that the
treated unit must lie within the "convex hull" of the control units [10].
The DiD framework exists within a broader landscape of quasi-experimental methods, each
with its own set of identifying assumptions and use cases.
● Regression Discontinuity (RD): This is a design-based approach that is applicable
when treatment is assigned based on a threshold or cutoff point in a continuous variable
[22, 23]. For example, a scholarship may be awarded only to students with a GPA above
3.5. RD compares outcomes for individuals just above and just below the cutoff,
essentially creating a localized randomized trial [22].
● Instrumental Variables (IV): This is a model-based approach that addresses
unobserved confounding by using a third variable, known as the "instrument," that is
correlated with the treatment but is otherwise unrelated to the outcome [22, 23]. For
instance, in a study of the effect of education on earnings, a change in a law that makes
it easier to attend school might serve as an instrument if it affects educational
attainment but does not independently influence earnings [22].
The choice between DiD, RD, and IV depends on the specific context of the "natural
experiment" and the structure of the available data. While all three methods aim to identify
causal relationships in the absence of randomization, they do so through different
mechanisms and with distinct identifying assumptions [23].
The principles of DiD are not merely theoretical constructs; they have been applied to
address some of the most important policy questions in modern history. Examining these
landmark studies provides a clear understanding of the method's power and its limitations.
The core logic of the DiD design was first applied in the mid-19th century by English physician
John Snow, who is considered the father of modern epidemiology [24, 25]. In his seminal
work, Snow investigated the cause of a cholera outbreak in London, challenging the
prevailing "miasma theory" that a foul-smelling vapor spread the disease [26].
Snow compared the change in cholera death rates for customers of the Lambeth Company
(the "treatment" group, who received cleaner water) to the change in death rates for
customers of the Southwark and Vauxhall Company (the "control" group, who continued to
receive polluted water) [25]. The stark difference in the change in death rates provided
compelling evidence that cholera was transmitted through contaminated water, not air. This
study is a perfect historical example of DiD, where two groups were essentially divided
without their choice, allowing for a credible causal inference based on a differential change
over time [27].
They surveyed over 400 fast-food restaurants in both states before and after the wage
increase [28]. Contrary to the conventional economic theory at the time, their findings
suggested that the minimum wage increase in New Jersey did not lead to a decline in
employment relative to Pennsylvania [18, 28].
The study's counterintuitive findings sparked a significant debate, with critics pointing out
potential flaws, including the study's limited time frame of only 11 months [18]. It was argued
that while the short-term effects may have been minimal, the long-term effects on job growth
and business creation could be negative. Later studies by Meer and West (2013) and Clemens
and Wither (2014) [18] supported this hypothesis, finding that minimum wage increases have
a negative effect on long-run job growth, even if the immediate effect on employment is not
observed [18]. The debate over the Card and Krueger study highlights a key limitation of the
simple 2x2 DiD design: it is best suited for estimating immediate or short-term effects and
may not capture the full, long-run impact of a policy [18].
A major modern application of DiD has been the evaluation of the Affordable Care Act's
(ACA) Medicaid expansion [7, 29, 30]. The ACA gave states the option to expand Medicaid
coverage to a broader population, and because some states chose to expand while others
did not, a natural experiment was created [14]. This policy variation allowed researchers to
use a DiD framework, often with a staggered treatment design, to study the effects of the
expansion [7, 30].
Numerous analyses have used DiD to compare changes in outcomes in expansion states with
those in non-expansion states [30]. The findings have been robust and multi-faceted.
Research consistently shows that Medicaid expansion states experienced significant gains in
health coverage and reductions in uninsured rates [30]. Studies have also documented
improvements in access to care, financial security for low-income populations, and even
reductions in mortality [30, 31]. For example, one study found a 15 percentage-point increase
in Medicaid coverage among near-elderly adults with low income, which was associated with
improvements in several health measures, including a 12% reduction in metabolic syndrome
[31].
This modern case study demonstrates the versatility and power of the DiD method. The use
of a staggered treatment design allowed researchers to estimate the effects of a major,
nationwide policy, and the ability to study a wide range of outcomes—from insurance
coverage and financial stability to specific clinical health measures—showcases the method's
broad applicability [30].
Conclusion
However, as this analysis demonstrates, the path from a simple textbook formula to a robust
empirical finding is fraught with complexities. The validity of the DiD estimator hinges on the
Parallel Trends Assumption, which, while unfalsifiable, must be rigorously assessed through a
battery of diagnostic checks, including event study analysis and placebo tests [5, 6].
Furthermore, the application of DiD in real-world settings with staggered treatment timing,
heterogeneous effects, and behavioral biases like anticipation and spillovers necessitates the
use of more advanced estimators and a deeper understanding of the underlying causal
mechanisms [7, 8, 20].
Ultimately, no single statistical method is a panacea for causal inference. The DiD framework,
when implemented with a nuanced understanding of its assumptions and limitations, and
complemented by modern extensions like DiDiD and SDID, provides a powerful and credible
means of evaluating policies and events in the complex, non-experimental world. The future
of the field lies in the continued development of these more robust methods that explicitly
address the subtle biases that can compromise the validity of the simple DiD design.