Enter Group Statistics

Group Means
Treatment group mean (before policy/event)
Treatment group mean (after policy/event)
Control group mean (before)
Control group mean (after)

Sample Sizes
Treatment group sample size (same before and after)
Control group sample size (same before and after)

Standard Deviations
Standard deviation, treatment group (before)
Standard deviation, treatment group (after)
Standard deviation, control group (before)
Standard deviation, control group (after)

Significance level for hypothesis testing
DiD Formula
DiD = (ΔYtreat) − (ΔYcontrol)
ΔYtreat = YTA − YTB | ΔYcontrol = YCA − YCB
Regression: y = b0 + b1·Treat + b2·After + b3·(Treat×After)
Ryan O'Connell, CFA
Calculator by Ryan O'Connell, CFA

DiD Results

DiD Treatment Effect (b3) 6.00 Significant
Treatment Change 10.00
Control Change 4.00
Standard Error 2.112
t-Statistic 2.841
p-Value 0.0048
Confidence Interval [1.85, 10.15]
Significant — reject H0 at 5% level

DiD Decomposition Chart

2×2 Summary & Regression Coefficients

Before After Change
Treatment 45.00 55.00 10.00
Control 40.00 44.00 4.00
Difference 5.00 11.00 DiD = 6.00
Regression Coefficient Mapping
b0 40.00 YCB
b1 5.00 YTB − YCB
b2 4.00 YCA − YCB
b3 (ATT) 6.00 DiD Effect
Counterfactual YTA: 49.00 ?

Formula Breakdown

DiD = (ΔYtreat) − (ΔYcontrol)
Step-by-step calculation with your values

Model Assumptions & Limitations

  • Parallel Trends (most critical): Absent treatment, the treatment group would have followed the same change in outcomes as the control group. This is an untestable assumption with only one pre-period.
  • No Anticipation Effects: The treatment group did not alter behavior before the intervention in expectation of it.
  • Stable Composition: No selection into or out of the treatment group over time.
  • No Spillovers (SUTVA): The treatment does not affect control group outcomes.
  • Sharp Treatment Timing: The intervention occurs at a single, well-defined point in time.
  • Group Independence: Treatment and control groups are independent samples.
  • No Concurrent Group-Specific Shocks: No other events differentially affected the treatment group during the study period.
Cluster-Robust Standard Errors: This calculator assumes independent observations within cells. Real-world DiD applications often require cluster-robust or wild-bootstrap standard errors. Results may understate uncertainty when observations are clustered (e.g., individuals within firms or states).
Scope: This calculator handles one-treated-group, one-control-group, one-pre, one-post DiD only. It does not cover staggered adoption, multi-period two-way fixed effects (TWFE), panel fixed effects estimation, synthetic control methods, or regression discontinuity designs.

For educational purposes. Not financial advice. Statistical conventions simplified for educational purposes.

Understanding Difference-in-Differences

What is Difference-in-Differences?

Difference-in-differences (DiD) is a quasi-experimental research design that estimates causal effects by comparing the change in outcomes over time between a treatment group (affected by a policy or event) and a control group (unaffected). The "double difference" removes both time-invariant group differences and common time trends, isolating the average treatment effect on the treated (ATT).

DiD Regression Equation
y = b0 + b1·Treatment + b2·After + b3·(Treatment × After) + u
b3 = DiD treatment effect (ATT under parallel trends)

The Parallel Trends Assumption

The key identifying assumption is that, absent the treatment, the treatment group would have experienced the same change (not level) in outcomes as the control group. With only one pre-period, this assumption cannot be tested directly. Researchers often use event-study designs with multiple pre-treatment periods to assess whether pre-treatment trends appear similar.

Textbook Example: Workers' Compensation

Wooldridge (Chapter 13) presents the Meyer, Viscusi, and Durbin (1995) study of Kentucky raising the cap on workers' compensation earnings coverage. The treatment group (high-income workers affected by the cap increase) showed a DiD estimate of 0.191 (t = 2.77), meaning the average duration on workers' compensation increased by about 19% for the affected group relative to the control.

Frequently Asked Questions

Difference-in-differences is a quasi-experimental research design that estimates causal effects by comparing the change in outcomes over time between a treatment group and a control group. The double difference removes both time-invariant group differences and common time trends, isolating the average treatment effect on the treated (ATT) under the parallel trends assumption.

The parallel trends assumption states that, absent treatment, the treatment and control groups would have experienced the same change (not level) in outcomes over time. This is the key identifying assumption for DiD. If the groups were already trending differently before treatment, the DiD estimate will be biased. Researchers often examine pre-treatment trends across multiple periods to assess plausibility.

The DiD coefficient b3 represents the average treatment effect on the treated (ATT) under parallel trends. It measures the additional change in the outcome for the treatment group compared to what would have been expected based on the control group's trend. A positive b3 means the treatment increased the outcome beyond the control trend; a negative b3 means it decreased it. Statistical significance is assessed via the t-test.

Common finance and regulatory examples include: the effect of changes in workers' compensation caps on claim duration (Wooldridge, Chapter 13), the impact of new environmental regulations on firm profitability, the effect of tax policy changes on corporate investment, and the impact of new infrastructure on property values (e.g., garbage incinerator proximity and housing prices from Kiel and McClain, 1995).

If parallel trends is violated, the DiD estimate captures both the true treatment effect and the pre-existing differential trend, resulting in bias. Researchers can use event-study designs to diagnose whether pre-treatment trends differ. Other approaches include triple-difference (DDD) estimators with an additional control group or adding covariates to control for differential trends.

A simple before-after comparison (Yafter − Ybefore for the treatment group only) confounds the treatment effect with any time trends that affect all groups. DiD removes this confound by subtracting the control group's change, which captures the common time trend. This makes DiD a more credible estimator of causal effects, provided the parallel trends assumption holds.
Disclaimer

This calculator is for educational purposes only and computes the 2×2 DiD treatment effect from group-level summary statistics. It assumes independent observations within cells and does not provide cluster-robust inference. For applied research, use statistical software (Stata, R, Python) with cluster-robust standard errors. This tool should not be used as the sole basis for policy or investment decisions.