Introduction To DiD Design
Introduction To DiD Design
SEMINAR
ABSTRACT
Because it is difficult to conduct randomized controlled trials, observational studies are often used when evaluating the
effects of health care policies. However, observational studies are subject to bias, such as a failure to eliminate the effects
of trends in the outcome over time and permanent differences between treatment and control groups. The difference-
in-differences design removes these biases by observing outcomes for the two groups at two time points. This article
introduces the methods and assumptions for the difference-in-differences design and provides some examples of studies
that have used this design.
KEY WORDS
Difference-in-differences design, parallel trends, common shocks
74
Introduction to difference-in-differences design
influences of trends and permanent differences between we are taking the difference between Difference 2 and
the two groups and correctly evaluate the effect of the Difference 1, this design is called “difference-in-
intervention. differences.”
Fig. 1 shows a conceptual diagram of difference-in-
differences analysis. In the control group, the outcome
B A S I C M E T H O D S F O R D I F F E R E N C E - I N-
changes from C1 to C2; in the intervention group, the
DIFFERENCES ANALYSIS
outcome changes from T1 to T2. The intervention group
has the same trend as the control group, and, if there Regression models are commonly used to estimate the
were no intervention in the intervention group, the out‐ effect of an intervention [2, 3]. Three variables are inclu‐
come in the intervention group at the second time point ded in the basic difference-in-differences model: (i) the
would be T2'. Therefore, the effect of the intervention is group assignment variable (presence or absence of the
T2 − T2'. Difference 1, the change in the outcome before intervention), (ii) time point (before or after the inter‐
and after the intervention in the control group, is vention), and (iii) the interaction term of these two fac‐
expressed as “C2 − C1.” Difference 2, the change in out‐ tors (multiplication of the two factors). The interaction
come for the intervention group over the same period, is term is the difference-in-differences estimator.
expressed as “T2 − T1.” Because the intervention and The equation of the difference-in-differences regres‐
control groups have the same trend, “C2 − C1” and “T2' sion model is
− T1” are equal. Therefore, the effect of the intervention Y = α + β1 * (intervention) + β2 * (time point) + β3 *
is expressed as Difference 2 − Difference 1 = (T2 − T1) − (intervention) * (time point),
(C2 − C1) = (T2 − T1) − (T2' −T1) = T2 − T2'. Because where Y is the outcome of interest, intervention is a
dummy variable for group assignment (intervention
group = 1, control group = 0), and time point is a dummy
variable for the time point (post-intervention = 1, pre-
intervention = 0).
Table 1 shows how to estimate the intervention effect
from the regression equation. The outcome before the
intervention in the intervention group is α + β1, substitut‐
ing 1 for intervention and 0 for time point in the above
regression equation. The post-intervention outcome for
the intervention group is α + β1 + β2 + β3, substituting 1
for intervention and for time point. Therefore, the change
in the outcome of the intervention group is (α + β1 + β2 +
β3) − (α + β1) = β2 + β3. Similarly, the change in the out‐
come of the control group before and after the interven‐
Fig. 1 Conceptual diagram of the difference-in-differences design tion is calculated as (α + β2) − α = β2. The difference
T1and T2 indicate the outcomes in the intervention group before and between these two outcomes, (β2 + β 3) − β 2 = β 3, which is
after the intervention. C1 and C2 indicate the outcomes in the con‐
the coefficient of the interaction term, shows the inter‐
trol group before and after the intervention. If the trends in the inter‐
vention and control groups are parallel, the post-intervention out‐ vention effect.
come in the intervention group would be T2' if this group did not
receive the intervention. Therefore, the effect of the intervention is
estimated as T2 − T2'.
Intervention-control β1 β1 + β3 β3 (=difference-in-differences)
75
ANNALS OF C L I N I C A L E P I D E M I O L O G Y
76
Introduction to difference-in-differences design
The regression model in this study was prised patients who underwent total hysterectomy at
Y = α + β1 * (Area) + β2 * (time point) + β3 * (Area) * the same institution. Preoperative administration of pro‐
(time point), phylactic antimicrobial agents for total hysterectomy was
where Y is the outcome of interest, Area is a dummy vari‐ recommended throughout the study period.
able for residence in the two areas where stroke services The regression model in this study was
were centralized (Area = 1 for London or Greater Man‐ SSI = α + β1 * (CS) + β2 * (time point) + β3 * (CS) *
chester, Area = 0 for other areas), time point is a dummy (time point),
variable for the time point (time point = 0 for before the where SSI is surgical site infection, CS is a dummy varia‐
centralization, time point = 1 for after the centralization), ble for cesarean section (CS = 1 for cesarean section, CS
and β3 is a difference-in-differences estimator. = 0 for total hysterectomy), time point is a dummy varia‐
The comparison of pre-intervention mortality and ble for the time point (time point = 0 for prior to January
length of stay between the two centralized areas and 2014, time point = 1 for January 2014 or later), and β3 is a
other areas showed no significant difference, which difference-in-differences estimator.
means the parallel trends assumption was not violated. The results showed no statistically significant differ‐
The results showed that 90-day mortality was signifi‐ ence in the risk of surgical site infection after the change
cantly decreased in London (−1.1%, 95% confidence in policy in January 2014: −0.6% (p = 0.663).
interval: −2.1 to −0.1) but not in Greater Manchester It is unclear whether the two assumptions of the
(0.1%, 95% confidence interval: −1.1 to 1.3). Length of difference-in-differences design were met in this study
hospital stay was significantly decreased in both areas because there is no description of either parallel trends or
(−1.4 days, 95% confidence interval: −2.3 to −0.5 in common shocks.
London; −2.0 days, 95% confidence interval: −2.8 to −1.2
in Greater Manchester).
CONCLUSIONS
2. “Timing of Antibiotic Prophylaxis in Cesarean Section: Before-and-after studies and cohort studies are subject to
Retrospective, Difference-in-Differences Estimation of the bias, such as the inability to identify the effects of trends
Effect on Surgical Site Infection” [6] over time and permanent differences between groups.
This study used a difference-in-differences design to Difference-in-differences analysis eliminates the effect of
determine whether changing the timing of prophylactic trends over time and permanent differences between the
antimicrobial administration for cesarean section from groups. Two critical assumptions in the difference-in-
immediately after cord ligation to preoperative adminis‐ differences design involve parallel trends and common
tration reduced the incidence of surgical site infection. shocks.
This study was a single-center report from the facility
with the highest number of deliveries in Israel, observed CONFLICT OF INTEREST
over four years from January 1, 2012, to December 31, None
2015. Before January 2014, prophylactic antimicrobial
agents were administered immediately after cord ligation ACKNOWLEDGMENTS
for cesarean sections at this facility. In January 2014, the This work was supported by the Ministry of Education, Culture,
policy was changed to administering the agents immedi‐ Sports, Science and Technology (Grant Numbers 19K19394,
ately before the start of surgery. The control group com‐ 21H03159).
REFERENCES
1. Dimick JB, Ryan AM. Methods for evaluat‐ Princeton, NJ: Princeton University Press; ropolitan areas on mortality and length of
ing changes in health care policy: the 2008. hospital stay: difference-in-differences analy‐
difference-in-differences approach. JAMA 4. Ryan AM, Burgess JF Jr, Dimick JB. Why sis. BMJ 2014;349:g4757.
2014;312:2401–2. We Should Not Be Indifferent to Specification 6. Ben Shoham A, Bar-Meir M, Ioscovich A,
2. Abadie A. Semiparametric difference-in- Choices for Difference-in-Differences. Health Samueloff A, Wiener-Well Y. Timing of anti‐
differences estimators. Rev Econ Stud 2005; Serv Res 2015;50:1211–35. biotic prophylaxis in cesarean section: retro‐
72:1–19. 5. Morris S, Hunter RM, Ramsay AI, Boaden spective, difference-in-differences estimation
3. Angrist JD, Pischke JS. Mostly Harmless R, McKevitt C, Perry C, et al. Impact of cen‐ of the effect on surgical-site-infection.
Econometrics: An Empiricist’s Companion. tralising acute stroke services in English met‐ JMFNM 2019;32:804–8.
77