Difference in Differences (DiD)
Difference-in-differences (DiD) is a quasi-experimental method that estimates a treatment effect by comparing the change in outcomes over time in a treated group with the change in an untreated comparison group.
이중차분법(DiD)은 처치집단의 시간에 따른 결과 변화와 비처치 비교집단의 변화를 비교하여 처치효과를 추정하는 준실험 방법이다.
How do I estimate the effect of a policy using before-and-after data with a comparison group?
비교집단이 있는 정책 시행 전후 자료로 정책 효과를 어떻게 추정하나요?
Difference-in-differences subtracts the before-after change in a comparison group from the before-after change in the treated group, removing stable group differences and common time trends. It fits policy evaluations with outcomes observed before and after implementation for both affected and unaffected units.
When to use Difference in Differences (DiD)
- A policy or program affects some units but not others at a known time
- Outcomes measured before and after for both treated and comparison units
- Repeated cross-sections or panel data at the unit level
When to use something else
- Treatment starts at different times across units: use staggered-adoption estimators such as Callaway-Sant'Anna rather than simple two-way fixed effects
- No credible comparison group exists: use synthetic control or interrupted time series
Assumptions and requirements
- Parallel trends: without treatment, both groups would have changed similarly
- No anticipation of treatment before it starts
- Group composition is stable over time
- No spillover of treatment to the comparison group
What the analysis reports
- DiD estimate (interaction coefficient) with cluster-robust standard errors
- Group-by-period means
- Event-study coefficients for pre- and post-treatment periods
- Pre-trend tests and a parallel trends plot
How to report it
The difference-in-differences estimate indicated that [policy] changed [outcome] by [value] (cluster-robust SE = [value], p = [value]), and pre-treatment coefficients showed no significant differential trends.
Related methods
- Event Study Design
- Synthetic Control Method
- Panel Fixed Effects Model
Run Difference in Differences (DiD) on Quorant
- Data you need
- a table (CSV or Excel) with an outcome variable, a treatment indicator and a time variable
- Price
- 400 credits for one analysis up to 10,000 rows (complexity level 3); larger or wider data costs more. Optional methodologist review: 1800 credits.
- Checking
- Python results are cross-checked against R reference outputs in every deployment
- Before you pay
- A free pre-analysis diagnosis checks your data and gives an exact quote; nothing is deducted until you approve it.