이중차분은 응용 경제학에서 가장 많이 쓰이는 인과 설계이고 가장 많이 잘못 쓰이는 설계입니다. 아이디어는 한 문장으로 충분합니다. 처치받은 집단의 시간에 따른 변화를 같은 기간 처치받지 않은 집단의 변화와 비교하고 그 차이의 차이를 처치 탓으로 돌립니다.
Differences-in-differences is the most used causal design in applied economics, and the most misused. The idea is simple enough to explain in a sentence: compare the change over time in a group that got treated against the change over the same period in a group that did not, and attribute the difference between those changes to the treatment.
그 단순함이 함정입니다. DiD는 돌리기 쉽고 제대로 돌리기 어렵습니다. 지난 10년의 계량경제학은 상당 부분 표준 구현이 어떻게 실패하는지를 발견하는 데 쓰였습니다.
The simplicity is the trap. DiD is easy to run and hard to run correctly, and the past decade of econometrics has been largely about discovering how the standard implementation fails.
두 번 차분해서 얻는 것What the two differences buy you
DiD가 거부하는 두 비교부터 봅시다.
Start with the two comparisons DiD rejects.
- 처치군만의 전후 비교. 같은 기간에 바뀐 다른 모든 것에 오염됩니다. 계절성, 거시 충격, 동시에 시행된 정책.
- 사후 시점의 처치군 대 대조군. 두 집단 사이에 원래 있던 차이에 오염됩니다.
- Before versus after, treated group only. Contaminated by anything else that changed over the same period — seasonality, a macro shock, a concurrent policy.
- Treated versus control, after only. Contaminated by any pre-existing difference between the groups.
DiD는 둘 다 제거합니다. 집단 내에서 시간 방향으로 차분하면 고정된 집단 특성이 사라집니다. 처치군을 다르게 만드는 것이 무엇이든 일정하기만 하면 됩니다. 집단 간으로 차분하면 그 기간 모두에게 일어난 변화가 사라집니다. 남는 것이 처치의 효과입니다.
DiD removes both. Differencing over time within a group eliminates fixed group characteristics — whatever makes the treated group different, as long as it is constant. Differencing across groups eliminates anything that changed for everyone. What survives is the effect of the treatment.
이 설계가 대단히 매력적인 이유는 두 집단이 비슷할 것을 요구하지 않는다는 데 있습니다. 수준에서 얼마든지 달라도 됩니다. 요구하는 것은 두 집단이 함께 움직였을 것이라는 점뿐입니다.
This is enormously appealing because it does not require the groups to be similar. They can differ arbitrarily in level. It only requires that they would have moved together.
모든 것이 걸린 가정The assumption everything rests on
근본적으로 검정 불가능하지만 비교란성과 달리 강력한 관측 가능한 대리물이 있습니다. 처치 이전에 두 집단이 평행하게 움직였다면 그것은 계속 그랬으리라는 실질적 증거입니다. 그래서 사건연구 그림이 신뢰할 만한 DiD의 중심에 있습니다.
That makes it fundamentally untestable, but unlike unconfoundedness it has a strong observable proxy: if the groups moved in parallel before treatment, that is real evidence they would have continued to. Which is why the event study plot is the centrepiece of any credible DiD.
사건연구는 처치 시점을 기준으로 각 기간마다 별도의 처치효과를 추정합니다. 처치 이전 계수들은 평평하고 통계적으로 0과 구분되지 않아야 합니다. 처치 이후 계수들이 시간에 따른 효과를 그려 냅니다. 이 그림 하나가 사전 추세와 시점과 동태를 한꺼번에 보여 줍니다. 이것이 없는 DiD는 믿지 않아야 합니다.
An event study estimates a separate treatment effect for each period relative to the treatment date. Pre-treatment coefficients should be flat and statistically indistinguishable from zero; post-treatment coefficients trace out the effect over time. This single plot shows pre-trends, timing and dynamics at once, and a DiD without one should not be trusted.
읽을 때 주의 둘. 첫째, 평평한 사전 추세를 기각하지 못했다는 것과 사전 추세가 평평하다는 것은 다릅니다. 검정력이 부족한 사전 기간 검정은 쉽게 통과합니다. Roth(2022)는 그 검정을 통과했다는 조건 자체가 추정치를 왜곡할 수 있음을 보입니다. 둘째, 평행추세는 척도 불변이 아닙니다. 수준에서 성립하고 로그에서 깨질 수 있고 그 반대도 됩니다. 함수 형태는 가정의 일부이지 중립적 선택이 아닙니다.
Two cautions on reading it. First, failing to reject flat pre-trends is not the same as pre-trends being flat — underpowered pre-period tests pass easily, and Roth (2022) shows that conditioning on passing them can itself distort the estimates. Second, parallel trends is not scale-invariant: it can hold in levels and fail in logs, or vice versa. The functional form is part of the assumption, not a neutral choice.
2×2 사례The 2x2 case
import numpy as np
import pandas as pd
import statsmodels.formula.api as smf
rng = np.random.default_rng(6)
TRUE_EFFECT = 3.0
n_units, n_periods = 400, 6
unit = np.repeat(np.arange(n_units), n_periods)
period = np.tile(np.arange(n_periods), n_units)
treated_unit = (unit % 2 == 0) # half the units
post = period >= 3 # all treated at the same time
# groups differ in LEVEL (fine) but share a common trend (the assumption)
unit_effect = np.repeat(rng.normal(scale=5, size=n_units), n_periods)
y = (10 + unit_effect + 0.5 * period
+ TRUE_EFFECT * (treated_unit & post)
+ rng.normal(size=len(unit)))
df = pd.DataFrame({"y": y, "unit": unit, "period": period,
"treated": treated_unit.astype(int),
"post": post.astype(int)})
did = smf.ols("y ~ treated * post", data=df).fit(
cov_type="cluster", cov_kwds={"groups": df["unit"]})
print(f"true effect : {TRUE_EFFECT:.3f}")
print(f"DiD (interaction): {did.params['treated:post']:.3f}"
f" se={did.bse['treated:post']:.3f}")true effect : 3.000
DiD (interaction): 2.985 se=0.071
2×2 경우를 완전히 이해하고 넘어가는 게 좋습니다. 더 복잡한 모든 버전이 이것의 조합으로 환원되기 때문입니다.
It is worth understanding the 2x2 case fully before moving on, because every more complicated version reduces to combinations of it.
엇갈린 도입 문제The staggered adoption problem
이 분야를 바꿔 놓은 부분입니다. 상당량의 출판된 연구가 이보다 앞서므로 분명히 말해 둘 값어치가 있습니다.
This is the part that changed the field, and it is worth stating plainly because a great deal of published work predates it.
모든 단위가 같은 시점에 처치되면 DiD를 구현하는 양방향 고정효과 회귀는 괜찮습니다. 단위마다 처치 시점이 다르면 — 단계적 시행, 즉 실제 정책 도입 대부분의 모습 — 그렇지 않습니다.
When all units are treated at the same time, the two-way fixed effects regression that implements DiD is fine. When units are treated at different times — staggered rollout, which describes most real policy adoption — it is not.
그 이후 개발된 해법들은 — Callaway와 Sant'Anna, Sun과 Abraham, de Chaisemartin과 d'Haultfœuille, Borusyak 등 — 모두 깨끗한 비교로만 제한하는 방식으로 작동합니다. 대개 아직 처치되지 않은 집단 대 막 처치된 집단을 비교하고 합리적인 가중치로 집계합니다. 설계에 엇갈린 시점이 있다면 순수한 양방향 고정효과 대신 이 중 하나를 쓰십시오.
The remedies developed since — Callaway and Sant'Anna, Sun and Abraham, de Chaisemartin and d'Haultfoeuille, Borusyak et al. — all work by restricting comparisons to clean ones, typically not-yet-treated against just-treated, then aggregating with sensible weights. If your design has staggered timing, use one of these rather than plain two-way fixed effects.
실무에서In practice
- 처치 배정 수준에서 표준오차를 클러스터링하십시오. Bertrand, Duflo, Mullainathan(2004)은 계열상관을 무시한 DiD 표준오차가 참인 귀무가설을 훨씬 자주 기각한다는 것을 보였습니다. 그들의 시뮬레이션에서 명목 5% 검정의 기각률이 45%에 가까웠습니다. 정책이 주 수준에서 변하면 개인이 아니라 주로 클러스터링하십시오. DiD에서 가장 흔한 추론 오류입니다.
- 클러스터가 적으면 통상적 클러스터링으로 충분하지 않습니다. 클러스터 로버스트 표준오차는 클러스터 수가 크다는 데 기댑니다. 대략 40개 아래면 반보수적입니다. 와일드 클러스터 부트스트랩이 표준 해법입니다. 처치된 클러스터가 아주 적으면 무작위화 추론이 더 방어 가능합니다.
- 항상 사건연구를 보이십시오. 강건성 확인이 아니라 주요 그림으로요. 사전 추세와 효과 시점과 동태를 동시에 전달하고, 독자가 설계를 직접 평가할 수 있게 합니다.
- 가정을 완화해도 결과가 살아남는지 검정하십시오. Rambachan과 Roth의 정직한 DiD는 이분법적 평행추세 가정을 그 가정에서 유계만큼 이탈하는 형태로 바꿉니다. 결과를 뒤집으려면 얼마나 큰 위반이 필요한지 보고합니다. 우연히 통과한 사전 추세 검정보다 훨씬 유익한 제시입니다.
- 예상 반응을 조심하십시오. 단위가 처치를 예상해서 미리 행동을 바꾸면 — 예고된 세제 변화에 앞서 조정하는 기업 — 사전 기간이 오염되고 추정치가 편향됩니다. 처치 직전 기간을 제외하거나 발표 시점을 명시적으로 모형화하면 됩니다.
- 구성을 확인하십시오. DiD는 집단을 시간에 걸쳐 비교하고 그 집단이 같은 집단이라고 가정합니다. 처치가 표본에 누가 있는지를 바꾸면 — 고용 자체가 결과인 최저임금 연구처럼 고용된 노동자의 구성이 바뀌는 경우 — 비교가 오염됩니다.
- 처치 단위가 하나면 합성통제를 고려하십시오. 처치된 지역 하나와 잠재적 대조군 여럿이 있을 때, 합성통제는 처치 단위의 사전 기간 경로를 맞추는 대조군들의 가중조합을 구성합니다. DiD 논리의 자연스러운 확장이고 명백한 비교군이 없을 때 더 신빙성 있는 경우가 많습니다.
- Cluster standard errors at the level of treatment assignment. Bertrand, Duflo and Mullainathan (2004) showed that DiD standard errors ignoring serial correlation reject a true null far more often than they should — rejection rates near 45% for a nominal 5% test in their simulations. If policy varies at the state level, cluster on state, not on individual. This is the single most common inference error in DiD.
- With few clusters, conventional clustering is not enough. Cluster-robust standard errors rely on the number of clusters being large; below roughly 40 they are anti-conservative. Wild cluster bootstrap is the standard fix, and with very few treated clusters randomisation inference is more defensible still.
- Always show the event study. Not as a robustness check — as the main figure. It communicates pre-trends, effect timing and dynamics simultaneously, and lets a reader evaluate the design directly.
- Test whether the result survives assumption relaxation. Rambachan and Roth honest DiD replaces the binary parallel-trends assumption with bounded deviations from it and reports how large a violation would be needed to overturn the finding. Far more informative than a pre-trends test that happened to pass.
- Watch for anticipation. If units change behaviour before treatment because they expect it — firms adjusting ahead of an announced tax change — the pre-period is contaminated and the estimate is biased. Excluding periods immediately before treatment, or explicitly modelling the announcement date, addresses it.
- Check composition. DiD compares groups over time and assumes they are the same groups. If treatment changes who is in the sample — a minimum wage study where employment itself is the outcome, so the composition of employed workers shifts — the comparison is contaminated.
- Consider synthetic control when you have one treated unit. With a single treated region and many potential controls, synthetic control constructs a weighted combination of controls matching the treated unit pre-period path. A natural extension of the DiD logic, often more credible when there is no obvious comparison group.
최저임금 연구(Card와 Krueger의 1994년 뉴저지 논문이 현대 DiD의 정본입니다), 주 단위 정책 평가, 산업의 단계적 기능 출시와 지역 시장 테스트, 인수합병 사후평가, 환경 규제 — 어떤 정책이 일부 단위에 어느 시점부터 켜지고 그 기간을 덮는 패널 데이터가 있는 곳이면 어디든 나옵니다.
Minimum wage studies (Card and Krueger 1994 New Jersey paper is the canonical modern DiD), state-level policy evaluation, staggered feature rollouts and geographic market tests in industry, merger retrospectives, environmental regulation. Anywhere a policy switches on for some units at some time and you have panel data spanning it.
이 설계의 인기는 정당합니다. 패널 데이터는 흔하고 가정은 관측 가능한 것에 의한 선택보다 약합니다. 다만 엇갈린 시점 문헌은 진짜 경고입니다. 단계적 시행에 양방향 고정효과를 쓴 출판 추정치가 상당량 편향되어 있다는 사실이 지금은 알려져 있습니다. 당시에는 아무도 의심하지 않던 방식이었습니다. 널리 받아들여진 방법이 곧 올바른 방법은 아니라는 것을 기억해 둘 만합니다.
The design popularity is well earned — panel data is common and the assumption is weaker than selection on observables. But the staggered-timing literature is a genuine caution: a large body of published estimates using two-way fixed effects on staggered rollouts is now known to be biased in ways nobody suspected at the time. A good reminder that a widely accepted method is not the same as a correct one.