Inferensys

Glossary

Difference-in-Differences

A quasi-experimental method that estimates a treatment effect by comparing the change in outcomes over time between a treated group and an untreated control group.
Control room desk with laptops and a large orchestration network display.
QUASI-EXPERIMENTAL CAUSAL INFERENCE

What is Difference-in-Differences?

A statistical technique for estimating a treatment effect by comparing the change in outcomes over time between a treated group and an untreated control group.

Difference-in-Differences (DiD) is a quasi-experimental design that estimates the causal effect of an intervention by comparing the pre- and post-treatment change in an outcome for a treated group against the same change for an untreated control group. The method subtracts the control group's time trend from the treated group's time trend, thereby removing biases from permanent differences between groups and from common time trends unrelated to the treatment.

The key identifying assumption is parallel trends: in the absence of treatment, the average outcome for the treated and control groups would have followed the same trajectory over time. In supply chain contexts, DiD is used to quantify the impact of a port closure, a new routing policy, or a supplier disruption by comparing affected nodes to similar unaffected nodes, isolating the disruption's true causal effect from broader market volatility.

QUASI-EXPERIMENTAL DESIGN

Key Characteristics of Difference-in-Differences

Difference-in-Differences (DiD) isolates causal effects by comparing the change in outcomes over time between a treated group and an untreated control group, removing biases from both time-invariant unobserved confounders and common temporal trends.

01

The Parallel Trends Assumption

The foundational requirement for valid DiD estimation. In the absence of treatment, the average outcome for the treated group would have followed the same trajectory as the control group.

  • This is inherently untestable for the post-treatment period
  • Researchers validate it by examining pre-treatment trends
  • Violations occur when groups are on divergent paths before the intervention
  • A common diagnostic: plot outcome means for both groups over multiple pre-treatment periods
  • If trends are not parallel, methods like Synthetic Control may be more appropriate
02

Two-Way Fixed Effects Regression

The canonical estimation equation for DiD includes fixed effects for both entity and time, absorbing all time-invariant unit heterogeneity and common period shocks.

  • The standard specification: Y_it = α_i + λ_t + δ * (Treat_i * Post_t) + ε_it
  • α_i captures unit fixed effects (e.g., a specific warehouse's constant efficiency)
  • λ_t captures time fixed effects (e.g., a global holiday demand surge)
  • The coefficient δ on the interaction term is the DiD estimator
  • This structure automatically controls for any unobserved, time-invariant confounders
03

Staggered Adoption Designs

Modern DiD extends beyond the classic 2x2 (two groups, two periods) setup to handle units receiving treatment at different points in time.

  • Traditional two-way fixed effects estimators can be severely biased with staggered adoption
  • The problem arises from using already-treated units as controls for later-treated units
  • New estimators like Callaway & Sant'Anna and Sun & Abraham solve this
  • These methods compute group-time average treatment effects and then aggregate them
  • Essential for supply chain interventions that roll out across regions in phases
04

Event Study Visualization

The standard method for presenting DiD results and visually inspecting the parallel trends assumption. It plots dynamic treatment effects for each period relative to the intervention.

  • The x-axis represents time relative to the treatment event (e.g., -4, -3, ..., 0, 1, 2)
  • The y-axis shows the estimated coefficient for each lead or lag
  • Pre-treatment coefficients should be statistically indistinguishable from zero
  • A flat pre-trend line with a sharp break at time zero is the ideal pattern
  • This reveals whether effects are immediate, delayed, or grow over time
05

Triple Difference (DDD)

An extension that adds a third dimension of comparison to control for confounding policy changes or group-specific time trends that threaten the parallel trends assumption.

  • Compares the DiD estimate in one subgroup to the DiD estimate in another
  • Example: Estimating the impact of a new warehouse robot on throughput
    • DiD 1: Treated vs. control warehouse, before vs. after robot installation
    • DiD 2: High-SKU zone vs. low-SKU zone within each warehouse
    • DDD: The differential effect of robots in high-SKU zones relative to low-SKU zones
  • This nets out any warehouse-wide shock that coincided with the robot deployment
06

Supply Chain Disruption Example

A concrete application: measuring the causal impact of a supplier bankruptcy on downstream manufacturer lead times.

  • Treated group: Manufacturers relying on the bankrupt supplier
  • Control group: Manufacturers using alternative suppliers with similar pre-trend lead times
  • Pre-period: 12 months of monthly lead time data before the bankruptcy filing
  • Post-period: 6 months after the filing
  • The DiD estimate isolates the disruption's effect from broader industry slowdowns
  • This avoids the naive comparison of simply looking at lead times before and after, which would conflate the disruption with a seasonal shipping crunch
CAUSAL INFERENCE

Frequently Asked Questions

Clear, technically precise answers to the most common questions about the Difference-in-Differences method for causal inference in supply chain disruption analysis.

Difference-in-Differences (DiD) is a quasi-experimental statistical technique that estimates the causal effect of a treatment or intervention by comparing the change in an outcome over time between a treated group and an untreated control group. The method calculates two differences: first, the change in the outcome for the treated group before and after the intervention; second, the change in the outcome for the control group over the same period. The DiD estimator is the difference between these two changes, effectively subtracting out the secular time trend that both groups share. The key identifying assumption is parallel trends, which posits that, in the absence of the treatment, the average outcome of the treated group would have followed the same trajectory as the control group. In a supply chain context, this allows an analyst to isolate the impact of a port closure on shipping lead times by comparing the pre-post change for routes using that port against the change for similar, unaffected routes.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.