Synthetic difference-in-differences (synthdid)
@misc{synthdid,
title = {synthdid},
author = {Arkhangelsky and Athey and Hirshberg and Imbens and Wager},
howpublished = {\url{https://github.com/synth-inference/synthdid}},
note = {Software / documentation}
}Follow the analysis.
Select a node to explore the method
Balanced panel + treated block
Data preparation — shapes the raw inputs into what the estimator expects.
Reshape to a (unit × time) outcome matrix with the treated cells marked.
library(synthdid)
setup <- panel.matrices(panel)
Before using this step, make its assumptions and its output explicit. A useful peer note explains what you would check, what could go wrong, or what would change your interpretation.
Questions to explore- Which assumption matters most here, and what evidence could challenge it?
- What would you check before passing this output to the next step?
Choose a question to start your comment.
Peer discussion
- Bring your experience, a question, or a different perspective.
Log in to comment on this step.
Solve for unit & time weights
The core estimate — where the causal quantity itself is computed.
Unit weights match pre-trends; time weights downweight uninformative periods.
tau.hat <- synthdid_estimate(setup$Y, setup$N0, setup$T0)
Before using this step, make its assumptions and its output explicit. A useful peer note explains what you would check, what could go wrong, or what would change your interpretation.
Questions to explore- Which assumption matters most here, and what evidence could challenge it?
- What would you check before passing this output to the next step?
Choose a question to start your comment.
Peer discussion
- Bring your experience, a question, or a different perspective.
Log in to comment on this step.
Placebo / jackknife standard errors
Uncertainty quantification — standard errors, intervals, and aggregation.
Variance from placebo reassignments or a jackknife over control units.
se <- sqrt(vcov(tau.hat, method = 'placebo'))
Before using this step, make its assumptions and its output explicit. A useful peer note explains what you would check, what could go wrong, or what would change your interpretation.
Questions to explore- Which assumption matters most here, and what evidence could challenge it?
- What would you check before passing this output to the next step?
Choose a question to start your comment.
Peer discussion
- Bring your experience, a question, or a different perspective.
Log in to comment on this step.
Plot trajectories & the gap
Reporting — turn the numbers into a figure or table a reader can act on.
Treated vs synthetic path, with the estimated effect shaded.
plot(tau.hat)
Before using this step, make its assumptions and its output explicit. A useful peer note explains what you would check, what could go wrong, or what would change your interpretation.
Questions to explore- Which assumption matters most here, and what evidence could challenge it?
- What would you check before passing this output to the next step?
Choose a question to start your comment.
Peer discussion
- Bring your experience, a question, or a different perspective.
Log in to comment on this step.
Inputs & data
A balanced panel (unit × time), with one or a few treated units that switch on at a known time.
Show data format & exampleHide example
Format — a unit × time outcome matrix; treatment turns on for some units after T0.
unit 2010 2011 2012* 2013*
A 8.1 8.4 9.0 9.3 # treated after 2011
B 7.9 8.0 8.1 8.2
⚠️ Unofficial community showcase of synthdid. Not affiliated with the authors; all credit to them.
Reweight both control units and pre-periods to build a synthetic control, then apply a DiD correction — robust where plain SC or TWFE struggle.
Discuss the workflow (0)
Log in to join the discussion.