# cdid capabilities and comparisons

R package version 1.3.0.0. Reviewed 2026-11-16.
Canonical documentation: https://www.davidbenatia.com/tools/cdid/
Source: https://github.com/dvbn/cdid/tree/b595cffabf9739d04d6b335604195450894ce958
Paper: https://arxiv.org/abs/2301.01085
CRAN: https://cran.r-project.org/package=cdid

Stata package: https://github.com/dvbn/cdid-stata
Stata guide: https://www.davidbenatia.com/tools/cdid/stata/
R-to-Stata correspondence: https://www.davidbenatia.com/tools/cdid/stata/from-r-cdid/

## Connect overlapping outcome histories

Combine supported within-unit changes across date pairs by GMM, with their covariance. Identification requires valid observation and parallel-trends restrictions, suitable controls, and sufficient support.
Guide: https://www.davidbenatia.com/tools/cdid/guide/examples/incomplete-panels/

## Adjust for selective observation

Choose observation weighting, actual-change imputation, or augmented reconstruction under conditional representativeness of mean changes and the documented model, support, and clipping conditions.
Guide: https://www.davidbenatia.com/tools/cdid/guide/methods/missing-outcomes/

## Choose treatment IPW, OR, or DR separately

Treatment weighting, counterfactual outcome regression, and doubly robust treatment adjustment are separate from the missing-outcome adjustment. The built-in conditional observation routes support all nine combinations.
Guide: https://www.davidbenatia.com/tools/cdid/guide/methods/treatment/

## Declare the study population

For cohort/adoption fits, an external unit table can include units observed once or never. Required cohort, covariate, weight and cluster information depends on the selected adjustment. The static switching route has separate data requirements.
Guide: https://www.davidbenatia.com/tools/cdid/guide/help/prepare-data/

## Chain across different cohort observation windows

Cross-pair comparisons can connect target and control changes measured over different intervals under the declared control parallel-trends restrictions. chain_report() identifies contributing comparisons and unavailable cells.
Guide: https://www.davidbenatia.com/tools/cdid/guide/methods/cross-pair-chaining/

## Estimate static binary switching effects

Use current binary treatment status for effects at entry and exit under no carryover. This route has its own input requirements and switcher-weighted aggregate; it is not a dynamic switching model.
Guide: https://www.davidbenatia.com/tools/cdid/guide/methods/static-entry-exit/

## The foundational chained-DiD framework

Bellégo, Benatia and Dortet-Bernadet’s chained DiD paper provides the foundational framework for chained difference-in-differences with incomplete outcome histories. It explicitly formalizes missing-trends assumptions, distinguishes representativeness of outcome changes from representativeness of levels, and establishes identification, estimation and inference using overlapping incomplete panels. Its conditional extensions address selection on observed characteristics. This framework underlies cdid’s treatment of missing outcomes.
Guide: https://www.davidbenatia.com/tools/cdid/missingness/#the-foundational-chained-did-framework
Sources:
- https://arxiv.org/html/2301.01085v4#S2.SS2
- https://doi.org/10.1016/j.jeconom.2024.105783

## Linear fixed effects and mean-change representativeness

In an additive linear model with correctly specified conditional mean changes, residuals with mean zero at every date conditional jointly on cohort, covariates, the unit effect, and the full observation history imply conditional mean representativeness of observed pairwise changes. This supplies a model-based sufficient condition for the mean form of the chained-DiD missing-trends restriction. Pairwise mean restrictions and full-history exogeneity are not identical, and selection on covariates requires the appropriate population averaging. This is a sufficient reconstruction of the connection, not a formal observation-history assumption explicitly stated in Wooldridge (2025), section 10.2.
Guide: https://www.davidbenatia.com/tools/cdid/missingness/#4-the-connection-to-mtcar-in-linear-fixed-effects-models
Sources:
- https://link.springer.com/article/10.1007/s00181-025-02807-z#Sec30
- https://arxiv.org/html/2301.01085v4#S2.SS2.SSS1

## Callaway-Sant'Anna: R did

Relationship: Direct delegation
Scope: mode = 'ordinary' delegates to did, including repeated cross sections. Chained mode agrees only in the documented matched cases, after aligning sample, comparison group, covariates, reference period, and aggregation.
Missingness: did balances the full panel by default; allowing an unbalanced panel uses repeated-cross-section computations. Chained mode instead combines supported within-unit changes and offers separate observation adjustments.
Inference: Ordinary mode delegates inference to did. A chained comparison additionally requires matching the covariance and aggregation conventions; matching point estimates alone does not establish matching inference.
Guide: https://www.davidbenatia.com/tools/cdid/guide/from-did/
Sources:
- https://bcallaway11.github.io/did/reference/att_gt.html
- https://doi.org/10.1016/j.jeconom.2020.12.001

## Callaway-Sant'Anna: Stata csdid

Relationship: Matched implementation comparison
Scope: Use the corresponding R calculation in ordinary mode or a documented matched chained case. Align the two-date samples, controls, nuisance fits, reference periods, and aggregation; cdid does not delegate to Stata.
Missingness: csdid 2.0.3 defaults to bal(full); bal(pair) retains units observed at both comparison dates, and bal(none) uses repeated-cross-section computations. Pair balancing is the legacy 1.82 observation rule. Chaining can use additional supported pairs.
Inference: Match variance, clustering, bootstrap, confidence-band, and aggregation conventions separately. No universal R-Stata inference equivalence is asserted.
Guide: https://www.davidbenatia.com/tools/cdid/guide/from-other-packages/
Sources:
- https://psantanna.com/csdid/articles/unbalanced-panels.html
- https://psantanna.com/csdid/articles/comparing-did-commands.html

## Wooldridge: linear etwfe and jwdid

Relationship: Matched linear equivalence
Scope: Use est_method = 'reg' with the cohort_time_fe preset. Match unit and date effects, unrestricted treated cohort-date effects, never-treated or not-yet-treated controls, and optional time-invariant covariates. Requires a never-treated cohort, equal unit weights, and zero anticipation.
Missingness: The documented match covers complete and incomplete panels on the same estimation rows. Use unit effects when observation dates vary within cohorts. Explicit observation correction is an additional cdid specification, outside the uncorrected regression match.
Inference: Matched cell effects and covariance require common effect-evaluation covariates, clustering, and sandwich normalization. Covariate-mean uncertainty and event-study aggregation weights must also be aligned; critical values are a separate choice.
Guide: https://www.davidbenatia.com/tools/cdid/guide/methods/cohort-time-fe/#match-r-etwfe-and-stata-jwdid
Sources:
- https://grantmcdermott.com/etwfe/reference/etwfe.html
- https://github.com/friosavila/stpackages/blob/main/jwdid/jwdid.sthlp
- https://doi.org/10.1007/s00181-025-02807-z

## Sun-Abraham: sunab and eventstudyinteract

Relationship: Matched specification and recorded benchmark
Scope: The cohort_time_fe preset with never-treated controls recovers the saturated linear cohort-event specification with the same reference period. The guide records complete-panel post-treatment cell comparisons against R fixest::sunab.
Missingness: The recorded benchmark is on complete panels. It does not establish a general incomplete-panel or selective-observation equivalence with either upstream command.
Inference: The stated benchmark concerns post-treatment cell point estimates. Event-study averages require the same cohort weights; covariance and inference are separate comparisons.
Guide: https://www.davidbenatia.com/tools/cdid/guide/from-other-packages/#matched-specifications-in-cdid
Sources:
- https://lrberge.github.io/fixest/reference/sunab.html
- https://github.com/lsun20/EventStudyInteract
- https://doi.org/10.1016/j.jeconom.2020.09.006

## Gardner and Borusyak-Jaravel-Spiess

Relationship: Complete-panel point-estimate equivalence
Scope: On a complete unweighted panel, use the cohort_time_fe preset, not-yet-treated controls, PT-all from the first date, and unrestricted post-treatment cohort-date effects. Match the untreated unit-and-date regression, optionally interacting baseline covariates with dates, and aggregate with the same weights.
Missingness: The recorded matches use complete panels. With incomplete outcomes, joint fixed-effects fitting and untreated-only imputation can use different information to estimate the untreated path. Actual-change imputation for selective observation is a separate operation.
Inference: The guide records post-treatment point-estimate matches to R did2s and didimputation. No general covariance or confidence-interval equivalence is claimed.
Guide: https://www.davidbenatia.com/tools/cdid/guide/from-other-packages/#two-stage-and-imputation-event-studies
Sources:
- https://kylebutts.github.io/did2s/
- https://github.com/kylebutts/didimputation
- https://github.com/borusyak/did_imputation
- https://doi.org/10.1093/restud/rdae007

## Dube-Girardi-Jorda-Taylor: LP-DiD

Relationship: Restricted long-difference equivalence
Scope: Match the unweighted clean-control long difference for a chosen baseline and horizon in the documented complete-panel, single-adoption-cohort design with never-treated controls. A pooled staggered comparison additionally requires identical risk sets and horizon weights.
Missingness: The illustrated equivalence does not establish an incomplete-panel match. Other LP-DiD weighting and baseline options are outside this comparison.
Inference: The claim is a point-estimate match for the stated long difference. It does not certify the complete LP-DiD interface or all variance and inference options.
Guide: https://www.davidbenatia.com/tools/cdid/guide/from-other-packages/#two-date-comparison-with-r-did
Sources:
- https://github.com/danielegirardi/lpdid
- https://doi.org/10.1002/jae.70000

## Harmon: stepwise DiD

Relationship: Consecutive-link construction
Scope: Estimate and sum consecutive two-date DiDs for one target cohort, using the cohorts still untreated at each step's endpoint. A standard chained fit can also use longer pairs and other supported control pools, so it need not give the same estimate.
Missingness: For an incomplete-panel comparison, match Harmon's target units eligible for the requested horizon and the observed controls in every step. Merely summing arbitrary pair-specific estimates does not establish the match.
Inference: The guide reproduces the point-estimate construction. Uncertainty for the sum must include covariance across steps because units can contribute to several comparisons.
Guide: https://www.davidbenatia.com/tools/cdid/guide/from-other-packages/#harmons-stepwise-did
Sources:
- https://web.econ.ku.dk/nharmon/docs/harmon2024onlineappendix.pdf
- https://web.econ.ku.dk/nharmon/docs/harmon2022difference.pdf

## DIDmultiplegtSTAT and did_multiplegt_stat

Relationship: Matched binary static benchmark
Scope: Supply current binary treatment through dname and compare the documented switcher summaries on complete panels without covariates. The static model requires no carryover; this comparison does not cover dynamic treatment histories or the upstream packages' full treatment scope.
Missingness: The recorded upstream benchmark uses complete panels. cdid additionally supports chained static estimation with incomplete outcomes under its observation and identification restrictions.
Inference: Use the guide's exact switcher aggregation and reference commands. The benchmark does not establish universal covariance or inference equivalence across STAT options.
Guide: https://www.davidbenatia.com/tools/cdid/guide/from-other-packages/#binary-static-switcher-summaries
Sources:
- https://cran.r-project.org/package=DIDmultiplegtSTAT
- https://github.com/Credible-Answers/did_multiplegt_stat
- https://arxiv.org/abs/2201.06898v7

## Balla-Elliott-Norwich: Cohort-Chained DiD

Relationship: Matched cohort-regression equivalence
Scope: Use not-yet-treated controls, universal base period, cross_pair = TRUE, pt_assumption = 'ctrl', and gmm_weighting = 'within'. Recover the stacked cohort-fixed-effects point estimates when observation dates are common within each cohort and the regression sample and weights agree.
Missingness: The matched cohort regression has common observation dates within cohorts. cdid's cross-pair implementation also supports within-individual changes with different observation dates and explicit selective-observation corrections under its stated assumptions.
Inference: The stated equivalence is for point estimates. Match sampling units, clusters, aggregation, and covariance conventions separately before comparing uncertainty.
Guide: https://www.davidbenatia.com/tools/cdid/guide/methods/cross-pair-chaining/#options-for-chaining
Sources:
- https://pdfs.dballaelliott.com/ccdid.pdf
- https://doi.org/10.1016/j.jeconom.2024.105783


