Familiar difference-in-differences models, with incomplete panels
Guide for cdid 1.3.0.0 (R). Recorded examples retain their stated versions.
On this page
A survey follows households for three years. Some households are interviewed in years 1 and 2, others in years 2 and 3. Few are interviewed in both years 1 and 3. The two shorter changes still tell us something about the longer interval. Chained difference-in-differences uses those changes to estimate treatment effects when the observation patterns and parallel trends assumptions support the comparisons. Worked example · Original chained DiD paper
cdid 1.3.0.0 puts several familiar estimators in the same R interface. It runs the Callaway–Sant’Anna estimator through did, fits the linear cohort-by-date model available in R’s etwfe and Stata’s jwdid, and recovers binary static switcher effects from did_multiplegt_stat. On matched complete panels, the fixed-effects option also recovers post-treatment estimates from Sun–Abraham, Gardner, and Borusyak–Jaravel–Spiess. The guide shows the unit-and-date fixed-effects match for Gardner and Borusyak–Jaravel–Spiess with and without baseline covariates. The package also recovers Harmon’s consecutive stepwise comparisons and the cohort-chained regression of Balla-Elliott and Norwich in their corresponding settings. A single-adoption design with never-treated controls gives the clean-control long differences used in LP-DiD. Commands and matched cases
What missing trends at random means
Taking changes within households removes persistent differences in their outcome levels. The original chained DiD paper asks whether households observed at both ends of a pair are representative of their cohort with respect to the mean change over that interval. We call this baseline missing trends completely at random (MTCAR). It is weaker than assuming that outcomes are missing completely at random (MCAR). Households with persistently low income can respond less often while their income changes remain representative. If response depends on a characteristic that also predicts income growth, those changes can be selective. Chained DiD paper, Assumptions 2 and 6
Repeated-cross-section DiD compares levels in the samples observed at different dates. Pair-balanced DiD compares changes for units observed at both dates of each comparison. Each needs its own assumption about representativeness. Chaining can use additional observed changes, and the observation correction addresses selection into those changes. How the commands use incomplete panels
When representativeness holds conditional on measured characteristics, cdid can weight changes by their probability of observation, predict missing actual changes, or combine both. This choice is separate from using outcome regression, treatment weighting, or doubly robust estimation to construct the treatment comparison. For example, you can fit the cohort-by-date model with a doubly robust treatment adjustment and an augmented correction for missing outcomes. Among the R and Stata implementations in the guide, cdid brings these observation corrections to chained estimates of the study population’s effects. Handling missing outcomes · Cohort-by-date example
The matched fits are fast on the tested panels. In a linear cohort-by-date benchmark with 10,000 units, 20 dates, missing outcomes and not-yet-treated controls, the fit including analytical inference took 0.036 seconds in cdid, 0.842 seconds in R’s etwfe, and 2.385 seconds in Stata’s jwdid. These are medians for the same intercept-only model and observed sample. Benchmark and comparison conditions
The static switching estimator is for settings where past treatment has no lingering effect. Future extensions include dynamic treatment histories and nonlinear cohort-by-date fits. To try the supported specifications, start with the matched commands and use the data guide to see which changes your panel can supply.
See the references for the matched methods.