<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Difference-in-Differences | David Benatia</title><link>https://www.davidbenatia.com/tag/difference-in-differences/</link><atom:link href="https://www.davidbenatia.com/tag/difference-in-differences/index.xml" rel="self" type="application/rss+xml"/><description>Difference-in-Differences</description><generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><lastBuildDate>Mon, 09 Nov 2026 00:00:00 +0000</lastBuildDate><image><url>https://www.davidbenatia.com/media/icon_huf51d053dcee75059daeadc3a21b01f3b_32112_512x512_fill_lanczos_center_3.png</url><title>Difference-in-Differences</title><link>https://www.davidbenatia.com/tag/difference-in-differences/</link></image><item><title>CDiD: Treatment Effects Beyond Complete Panels</title><link>https://www.davidbenatia.com/post/cdid-incomplete-panels/</link><pubDate>Mon, 09 Nov 2026 00:00:00 +0000</pubDate><guid>https://www.davidbenatia.com/post/cdid-incomplete-panels/</guid><description>&lt;p>A firm enters a survey late. A household misses an interview. An administrative database records an outcome in some years but not others. In a rotating panel, every unit may be observed for only a short window. These are familiar features of applied research, yet restricting the analysis to units observed throughout can discard much of the data, change the population being studied, or leave no observations at all.&lt;/p>
&lt;p>&lt;strong>&lt;code>cdid&lt;/code> estimates treatment effects by connecting the changes that are observed.&lt;/strong> Different units can supply different parts of the history. When those comparisons represent the same study population and satisfy the identifying assumptions, chaining them recovers effects over longer horizons.&lt;/p>
&lt;p>Since the &lt;a href="https://www.davidbenatia.com/post/cdid-library/">original introduction&lt;/a>, the package has grown into a broader toolkit. It now brings together chained IPW, outcome regression, and doubly robust estimation; three corrections for covariate-dependent missing outcomes; alternative parallel-trends restrictions; and familiar tools for event studies and inference. Version 1.2.0.1 is &lt;a href="https://cran.r-project.org/package=cdid" target="_blank" rel="noopener">available on CRAN&lt;/a>.&lt;/p>
&lt;h2 id="the-useful-information-is-in-the-changes">The useful information is in the changes&lt;/h2>
&lt;p>The starting point is our paper with Christophe Bellégo and Vincent Dortet-Bernadet, &lt;a href="https://doi.org/10.1016/j.jeconom.2024.105783" target="_blank" rel="noopener">&lt;em>The Chained Difference-in-Differences&lt;/em>&lt;/a>, published in the &lt;em>Journal of Econometrics&lt;/em> in 2025. The package builds on the cohort and period treatment effects of &lt;a href="https://doi.org/10.1016/j.jeconom.2020.12.001" target="_blank" rel="noopener">Callaway and Sant&amp;rsquo;Anna (2021)&lt;/a> and their &lt;code>did&lt;/code> package.&lt;/p>
&lt;p>Imagine treatment begins at date 3. One group of units is observed at dates 2 and 3, a second at dates 3 and 4, and a third at dates 4 and 5. No unit is observed at both the reference date 2 and the final date 5.&lt;/p>
&lt;p>
&lt;figure >
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Three groups supply overlapping two-date observations: dates 2–3, 3–4, and 4–5. Valid comparisons connect the reference date to the final treatment effect."
src="https://www.davidbenatia.com/post/cdid-incomplete-panels/chaining.svg"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;/p>
&lt;p>For each window, compare the outcome change of treated units with the change of suitable controls. Under parallel trends and representative mean changes, the first comparison identifies the effect at date 3. The next identifies how that effect changes between dates 3 and 4; the final comparison supplies the next increment. Their sum recovers the effect at date 5.&lt;/p>
&lt;p>The units do not need identical individual changes. What matters is that each comparison represents the relevant cohort and control populations. When several valid comparisons inform the same effect, &lt;code>cdid&lt;/code> combines them by generalized method of moments, accounting for their covariance.&lt;/p>
&lt;p>The &lt;a href="https://github.com/dvbn/cdid/blob/main/docs/examples/incomplete-panels.md" target="_blank" rel="noopener">rotating-panel example&lt;/a> makes this concrete: &lt;strong>1,000 units, five dates, two observed outcomes per unit, and zero complete cases&lt;/strong>. Chaining recovers all three requested posttreatment effects. With true effects of 1.00, 1.25, and 1.50, the recorded estimates are 0.895, 1.202, and 1.350, with analytical standard errors of 0.092, 0.125, and 0.157.&lt;/p>
&lt;h2 id="why-changing-composition-need-not-erase-identification">Why changing composition need not erase identification&lt;/h2>
&lt;p>Incomplete panels raise a second issue: the units observed at one date can differ systematically from those observed at another. Comparing their average outcome levels can then mix treatment effects with changes in sample composition.&lt;/p>
&lt;p>Within-unit differences remove stable unit effects. A persistently high outcome level disappears when we subtract one observation of that unit from another. This permits observation to depend on an unobserved fixed component, provided that selection does not also distort the mean changes needed for the analysis.&lt;/p>
&lt;p>The guide&amp;rsquo;s &lt;a href="https://github.com/dvbn/cdid/blob/main/docs/examples/identification.md" target="_blank" rel="noopener">changing-composition example&lt;/a> follows this idea. Each unit is observed at two consecutive dates. Treated units with high fixed outcomes tend to appear early; those with low fixed outcomes appear late. The true treatment effect is 1 at every posttreatment date. In this design, the population comparisons are:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Period&lt;/th>
&lt;th style="text-align:right">True effect&lt;/th>
&lt;th style="text-align:right">Chained comparisons&lt;/th>
&lt;th style="text-align:right">Comparisons of observed levels&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>3&lt;/td>
&lt;td style="text-align:right">1.00&lt;/td>
&lt;td style="text-align:right">1.00&lt;/td>
&lt;td style="text-align:right">0.60&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>4&lt;/td>
&lt;td style="text-align:right">1.00&lt;/td>
&lt;td style="text-align:right">1.00&lt;/td>
&lt;td style="text-align:right">0.20&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>5&lt;/td>
&lt;td style="text-align:right">1.00&lt;/td>
&lt;td style="text-align:right">1.00&lt;/td>
&lt;td style="text-align:right">0.00&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>These are &lt;strong>population calculations&lt;/strong>, rather than fitted estimates. They show why observation that selects outcome levels can still leave useful changes. In the recorded sample, the date-5 chained estimate is 0.868; the observed-level estimate is −0.063.&lt;/p>
&lt;p>The distinction is substantive. If the stable component also predicts untreated trends or treatment-effect heterogeneity, removing it from levels does not automatically remove selection in changes. Conversely, when each date&amp;rsquo;s observed sample represents the population, comparisons of levels can be valid too.&lt;/p>
&lt;h2 id="flexible-adjustment-across-treatment-cohorts">Flexible adjustment across treatment cohorts&lt;/h2>
&lt;p>The package estimates ATT(g,t): the average effect at date t for units first treated at date g. This allows staggered adoption and effects that differ by cohort and time since treatment. Researchers can choose never treated or not yet treated controls and adjust for covariates through IPW, OR, or DR.&lt;/p>
&lt;p>In the &lt;a href="https://github.com/dvbn/cdid/blob/main/docs/examples/treatment-choice.md" target="_blank" rel="noopener">treatment-choice example&lt;/a>, 2,000 units are followed over six dates, with two treatment cohorts, incomplete outcomes, and treatment assignment related to a covariate. All three approaches track the known event-time pattern:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Time since treatment&lt;/th>
&lt;th style="text-align:right">True effect&lt;/th>
&lt;th style="text-align:right">IPW&lt;/th>
&lt;th style="text-align:right">OR&lt;/th>
&lt;th style="text-align:right">DR&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>0&lt;/td>
&lt;td style="text-align:right">1.00&lt;/td>
&lt;td style="text-align:right">1.028&lt;/td>
&lt;td style="text-align:right">1.032&lt;/td>
&lt;td style="text-align:right">1.026&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>1&lt;/td>
&lt;td style="text-align:right">1.25&lt;/td>
&lt;td style="text-align:right">1.240&lt;/td>
&lt;td style="text-align:right">1.230&lt;/td>
&lt;td style="text-align:right">1.238&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>2&lt;/td>
&lt;td style="text-align:right">1.50&lt;/td>
&lt;td style="text-align:right">1.538&lt;/td>
&lt;td style="text-align:right">1.530&lt;/td>
&lt;td style="text-align:right">1.528&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>3&lt;/td>
&lt;td style="text-align:right">1.75&lt;/td>
&lt;td style="text-align:right">1.744&lt;/td>
&lt;td style="text-align:right">1.724&lt;/td>
&lt;td style="text-align:right">1.729&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The columns are estimates from the same generated panel. Their agreement illustrates how several treatment adjustments fit within one chained framework; it does not require choosing a different target or discarding incomplete histories.&lt;/p>
&lt;h2 id="correcting-for-who-gets-observed">Correcting for who gets observed&lt;/h2>
&lt;p>Treatment adjustment and missing-outcome adjustment answer different questions. A treatment propensity model helps make a cohort comparable with controls. An observation model helps make the changes we observe representative of the population we want to study. Addressing one does not automatically address the other.&lt;/p>
&lt;p>When measured covariates explain selection in mean changes, &lt;code>selection = &amp;quot;conditional_mtar&amp;quot;&lt;/code> enables three approaches:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Observation weighting:&lt;/strong> reweight observed changes by their probability of being observed at both dates.&lt;/li>
&lt;li>&lt;strong>Change imputation:&lt;/strong> model actual changes, including treatment effects, and predict them for the study population.&lt;/li>
&lt;li>&lt;strong>Augmented correction:&lt;/strong> combine change predictions with weighted prediction errors from observed units.&lt;/li>
&lt;/ul>
&lt;p>The &lt;a href="https://github.com/dvbn/cdid/blob/main/docs/examples/change-imputation.md" target="_blank" rel="noopener">change-imputation example&lt;/a> compares these approaches on one incomplete panel where their required models are correctly specified. The recorded average-effect estimates are &lt;strong>1.624 with weighting, 1.629 with imputation, and 1.629 with augmentation&lt;/strong>, each with a standard error near 0.038. The known average effect for the generated treated units is 1.627.&lt;/p>
&lt;p>Treatment DR combined with the augmented correction provides robustness in both layers. Either the treatment propensity or counterfactual regression must be correct, and either the observation or actual-change model must be correct, with the other identification and regularity conditions maintained. The &lt;a href="https://github.com/dvbn/cdid/blob/main/docs/examples/robustness.md" target="_blank" rel="noopener">model-robustness guide&lt;/a> explains these alternatives and distinguishes theoretical guarantees from executed examples.&lt;/p>
&lt;h2 id="more-information-when-stronger-assumptions-are-credible">More information when stronger assumptions are credible&lt;/h2>
&lt;p>By default, &lt;strong>PT-post&lt;/strong> imposes parallel trends from each cohort&amp;rsquo;s reference period onward. &lt;strong>PT-all&lt;/strong> adds restrictions from a chosen common start date. These additional restrictions can make more effects available or improve precision when they are credible.&lt;/p>
&lt;p>The &lt;a href="https://github.com/dvbn/cdid/blob/main/docs/examples/pt-all-comparison.md" target="_blank" rel="noopener">PT-all walkthrough&lt;/a> compares both choices on the same incomplete panel, then introduces an earlier untreated outcome pulse that violates the stronger assumption. It shows why choosing restrictions is an economic judgment: additional information is useful only when the assumptions that justify it hold. The start date should be chosen on substantive grounds before inspecting results.&lt;/p>
&lt;p>Chaining can also improve precision relative to level comparisons by removing persistent differences between units. The size of that gain depends on outcome persistence, the observation windows, and the covariance of the comparisons. The &lt;a href="https://github.com/dvbn/cdid/blob/main/docs/examples/precision.md" target="_blank" rel="noopener">precision guide&lt;/a> explains the trade-offs.&lt;/p>
&lt;p>The numerical examples above are recorded runs from October 29, 2026, using &lt;code>cdid&lt;/code> 1.1.0.0, &lt;code>did&lt;/code> 2.5.1, and &lt;code>DRDID&lt;/code> 1.3.0 under R 4.5.2. The OR/DR examples retain their historical pooled outcome specification; the current default fits separate comparison regressions. Together, the examples demonstrate useful behavior across distinct designs. They do not establish repeated-sample bias, coverage, or a universal precision advantage for the current release.&lt;/p>
&lt;h2 id="a-familiar-r-workflow">A familiar R workflow&lt;/h2>
&lt;p>Getting started requires a standard R installation:&lt;/p>
&lt;pre>&lt;code class="language-r">install.packages(&amp;quot;cdid&amp;quot;)
library(cdid)
vignette(&amp;quot;cdid&amp;quot;, package = &amp;quot;cdid&amp;quot;)
&lt;/code>&lt;/pre>
&lt;p>Estimate cohort and period effects with &lt;code>cdid::att_gt()&lt;/code>, aggregate them with &lt;code>cdid::aggte()&lt;/code>, and plot them with &lt;code>cdid::ggdid()&lt;/code>. The package supports event-time, cohort, calendar, and overall summaries, analytical or multiplier inference, clustering, simultaneous bands, and pretrend tests. &lt;code>tidy()&lt;/code> and &lt;code>glance()&lt;/code> expose results and support diagnostics. Ordinary mode delegates to &lt;code>did&lt;/code>, including for repeated cross sections.&lt;/p>
&lt;p>For incomplete panels, keep missing outcomes as &lt;code>NA&lt;/code>. Define the study population with a unit table supplied through &lt;code>frame&lt;/code> when needed, rather than allowing complete-case selection to define it implicitly. Inspect which effects are supported: a chain needs valid comparisons, adequate overlap, and the relevant missingness assumptions. Unsupported effects are reported with a reason.&lt;/p>
&lt;p>Visit the &lt;strong>&lt;a href="https://www.davidbenatia.com/projects/cdid-library/">updated project page&lt;/a>&lt;/strong> for an overview, the &lt;strong>&lt;a href="https://github.com/dvbn/cdid/blob/main/docs/README.md" target="_blank" rel="noopener">full guide&lt;/a>&lt;/strong> for methods and examples, and the &lt;strong>&lt;a href="https://github.com/dvbn/cdid/blob/main/notebooks/README.md" target="_blank" rel="noopener">practical notebook&lt;/a>&lt;/strong> to explore the workflow on a configurable synthetic panel. Source code and issue reporting are on &lt;strong>&lt;a href="https://github.com/dvbn/cdid" target="_blank" rel="noopener">GitHub&lt;/a>&lt;/strong>.&lt;/p>
&lt;hr>
&lt;p>Bellégo, C., Benatia, D., and Dortet-Bernadet, V. (2025). &lt;a href="https://doi.org/10.1016/j.jeconom.2024.105783" target="_blank" rel="noopener">The Chained Difference-in-Differences&lt;/a>. &lt;em>Journal of Econometrics&lt;/em>, 248, article 105783.&lt;/p></description></item><item><title>cdid: Difference-in-Differences for Incomplete Panels</title><link>https://www.davidbenatia.com/projects/cdid-library/</link><pubDate>Sun, 22 Dec 2024 00:00:00 +0000</pubDate><guid>https://www.davidbenatia.com/projects/cdid-library/</guid><description>&lt;p>&lt;strong>Real panels are rarely complete. &lt;code>cdid&lt;/code> makes their observed changes useful.&lt;/strong> The package estimates treatment effects by combining comparisons between the dates at which the same units are observed. It works with complete panels, intermittent missing outcomes, and rotating observation windows, including designs in which no unit is followed throughout the study.&lt;/p>
&lt;p>&lt;code>cdid&lt;/code> builds on the &lt;a href="https://bcallaway11.github.io/did/" target="_blank" rel="noopener">&lt;code>did&lt;/code> package&lt;/a> and the chained difference-in-differences method of &lt;a href="https://doi.org/10.1016/j.jeconom.2024.105783" target="_blank" rel="noopener">Bellégo, Benatia, and Dortet-Bernadet (2025)&lt;/a>. It combines flexible treatment adjustment, corrections for missing outcomes, alternative parallel-trends assumptions, and tools for inference and visualization in one R workflow.&lt;/p>
&lt;p>&lt;strong>&lt;a href="https://cran.r-project.org/package=cdid" target="_blank" rel="noopener">Install from CRAN&lt;/a>&lt;/strong> · &lt;strong>&lt;a href="https://github.com/dvbn/cdid" target="_blank" rel="noopener">GitHub&lt;/a>&lt;/strong> · &lt;strong>&lt;a href="https://github.com/dvbn/cdid/blob/main/docs/README.md" target="_blank" rel="noopener">Full user guide&lt;/a>&lt;/strong> · &lt;strong>&lt;a href="https://www.davidbenatia.com/post/cdid-incomplete-panels/">Read the new overview&lt;/a>&lt;/strong>&lt;/p>
&lt;h2 id="one-framework-many-research-designs">One framework, many research designs&lt;/h2>
&lt;p>The target is the average treatment effect for a cohort in a given period, ATT(g,t), where a cohort contains units first treated at the same date. Effects can differ across cohorts and evolve with time since treatment. The observation pattern determines which comparisons contribute, rather than requiring every unit to have a complete history.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Your setting&lt;/th>
&lt;th>What &lt;code>cdid&lt;/code> provides&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Balanced panels&lt;/td>
&lt;td>Chained estimation using complete outcome histories, with ordinary &lt;code>did&lt;/code> estimation available as an explicit alternative.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Unbalanced or rotating panels&lt;/td>
&lt;td>Combines within-unit changes from overlapping observation windows; complete cases need not exist.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Staggered treatment adoption&lt;/td>
&lt;td>Cohort and period effects, never treated or not yet treated controls, and event-study aggregation.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Covariates related to treatment or trends&lt;/td>
&lt;td>Inverse probability weighting (IPW), outcome regression (OR), or doubly robust (DR) treatment adjustment.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Covariates related to missing outcomes&lt;/td>
&lt;td>Observation weighting, imputation of actual outcome changes, or an augmented correction combining both.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Different credible trend restrictions&lt;/td>
&lt;td>PT-post from each cohort&amp;rsquo;s reference period, or the stronger PT-all assumption from a chosen common start date.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Repeated cross sections&lt;/td>
&lt;td>Ordinary mode delegates to &lt;code>did&lt;/code>; chaining uses repeated observations of the same units.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Inference and reporting&lt;/td>
&lt;td>Analytical or multiplier bootstrap inference, clustering, simultaneous bands, pretrend tests, aggregation, plots, and export.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>These choices let researchers adapt the analysis to the design and its assumptions. The &lt;a href="https://github.com/dvbn/cdid/blob/main/docs/reference/options.md" target="_blank" rel="noopener">options reference&lt;/a> describes supported combinations and defaults.&lt;/p>
&lt;h2 id="how-chaining-uses-incomplete-histories">How chaining uses incomplete histories&lt;/h2>
&lt;p>Suppose one group of units is observed at dates 2 and 3, another at dates 3 and 4, and another at dates 4 and 5. No unit spans dates 2 to 5. With valid comparisons in each window, the first comparison identifies the treatment effect at date 3, and the next two identify its subsequent changes. Combining them recovers the later effects.&lt;/p>
&lt;p>When several comparisons inform the same effect, &lt;code>cdid&lt;/code> combines them by generalized method of moments (GMM), accounting for their covariance. This uses information distributed across the panel while retaining the effects of the declared study population as the target.&lt;/p>
&lt;p>The distinction between &lt;strong>changes and levels&lt;/strong> matters. Differencing removes persistent unit effects. Observation can therefore depend on a stable, unobserved component of outcomes without invalidating chained comparisons, provided the observed changes still represent the cohort&amp;rsquo;s mean changes. If that component also predicts trends or heterogeneous treatment effects, additional assumptions or adjustments are needed. See the &lt;a href="https://github.com/dvbn/cdid/blob/main/docs/examples/identification.md" target="_blank" rel="noopener">identification example&lt;/a>.&lt;/p>
&lt;h2 id="what-the-worked-examples-demonstrate">What the worked examples demonstrate&lt;/h2>
&lt;p>The guide provides executable examples with known effects and recorded estimates across several settings:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Example&lt;/th>
&lt;th>What it shows&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;a href="https://github.com/dvbn/cdid/blob/main/docs/examples/incomplete-panels.md" target="_blank" rel="noopener">Rotating panel&lt;/a>&lt;/td>
&lt;td>All 1,000 units have only two of five outcomes observed. Chaining recovers all three requested posttreatment effects despite having no complete cases.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;a href="https://github.com/dvbn/cdid/blob/main/docs/examples/identification.md" target="_blank" rel="noopener">Changing sample composition&lt;/a>&lt;/td>
&lt;td>Observation depends on an unobserved fixed component. Chained comparisons identify effects of 1 at each posttreatment date; observed-level comparisons instead converge to 0.6, 0.2, and 0 in this design.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;a href="https://github.com/dvbn/cdid/blob/main/docs/examples/treatment-choice.md" target="_blank" rel="noopener">Treatment adjustment&lt;/a>&lt;/td>
&lt;td>IPW, OR, and DR track the known dynamic effects in an incomplete panel with two treatment cohorts and covariate-dependent assignment.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;a href="https://github.com/dvbn/cdid/blob/main/docs/examples/change-imputation.md" target="_blank" rel="noopener">Missing-outcome corrections&lt;/a>&lt;/td>
&lt;td>Weighting, change imputation, and the augmented correction give closely aligned estimates when their models are correctly specified.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;a href="https://github.com/dvbn/cdid/blob/main/docs/examples/pt-all-comparison.md" target="_blank" rel="noopener">Parallel-trends choices&lt;/a>&lt;/td>
&lt;td>Compares PT-post and PT-all on the same panel, including a case where the additional restrictions are false.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>These examples illustrate the package&amp;rsquo;s breadth and behavior under stated assumptions. Their recorded numerical results use &lt;code>cdid&lt;/code> 1.1.0.0; the pages identify their dependencies and settings. They are individual runs, rather than a completed repeated-sample evaluation. The &lt;a href="https://www.davidbenatia.com/post/cdid-incomplete-panels/">new blog post&lt;/a> walks through selected results.&lt;/p>
&lt;p>Chaining can also improve precision relative to comparisons of levels when removing persistent unit differences reduces noise. The gain depends on the observation pattern, outcome persistence, and covariance between comparisons. Valid additional restrictions may help; a universal precision ranking does not follow. The &lt;a href="https://github.com/dvbn/cdid/blob/main/docs/examples/precision.md" target="_blank" rel="noopener">precision guide&lt;/a> explains how to compare methods on matching targets and assumptions.&lt;/p>
&lt;h2 id="treatment-adjustment-and-missingness-are-separate-choices">Treatment adjustment and missingness are separate choices&lt;/h2>
&lt;p>Making treated units comparable with controls is one task. Making observed changes representative of the study population is another. &lt;code>cdid&lt;/code> lets you address both:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Treatment:&lt;/strong> choose IPW, OR, or DR through &lt;code>est_method&lt;/code>.&lt;/li>
&lt;li>&lt;strong>Missing outcomes:&lt;/strong> when mean changes are representative conditional on measured covariates, use &lt;code>selection = &amp;quot;conditional_mtar&amp;quot;&lt;/code> and choose weighting, imputation, or the augmented correction through &lt;code>selection_est_method&lt;/code>.&lt;/li>
&lt;/ul>
&lt;p>With treatment DR and the augmented missing-outcome correction, robustness applies in both layers: either the treatment propensity or counterfactual regression must be correct, and either the observation or change-imputation model must be correct, together with the remaining identification and regularity conditions. The &lt;a href="https://github.com/dvbn/cdid/blob/main/docs/methods/missing-outcomes.md#which-models-must-be-correct" target="_blank" rel="noopener">missing-outcomes guide&lt;/a> states the precise alternatives.&lt;/p>
&lt;p>Parallel trends, no anticipation, adequate support, and the relevant assumptions about missing changes remain essential. Effects the available comparisons cannot recover are reported as unavailable with a reason. The package supplies diagnostics to make those limits visible.&lt;/p>
&lt;h2 id="get-started-in-r">Get started in R&lt;/h2>
&lt;p>Version &lt;strong>1.2.0.1&lt;/strong> was &lt;a href="https://cran.r-project.org/package=cdid" target="_blank" rel="noopener">published on CRAN on November 7, 2026&lt;/a>. It requires R 4.1.0 or later.&lt;/p>
&lt;pre>&lt;code class="language-r">install.packages(&amp;quot;cdid&amp;quot;)
library(cdid)
# Open the packaged introduction and incomplete-panel example.
vignette(&amp;quot;cdid&amp;quot;, package = &amp;quot;cdid&amp;quot;)
&lt;/code>&lt;/pre>
&lt;p>The familiar workflow is &lt;code>cdid::att_gt()&lt;/code> to estimate cohort and period effects, &lt;code>cdid::aggte()&lt;/code> to aggregate them, and &lt;code>cdid::ggdid()&lt;/code> to plot them. &lt;code>cdid::tidy()&lt;/code> and &lt;code>cdid::glance()&lt;/code> expose estimates and diagnostics for reporting. Panel data use chained mode by default; &lt;code>mode = &amp;quot;ordinary&amp;quot;&lt;/code> calls the corresponding &lt;code>did&lt;/code> estimator.&lt;/p>
&lt;p>For incomplete panels, keep missing outcomes as &lt;code>NA&lt;/code> and supply a unit table through &lt;code>frame&lt;/code> when needed to represent the full study population, including units with one or no observed outcomes. Follow &lt;a href="https://github.com/dvbn/cdid/blob/main/docs/help/prepare-data.md" target="_blank" rel="noopener">Prepare your panel and unit table&lt;/a> and &lt;a href="https://github.com/dvbn/cdid/blob/main/docs/help/investigate-missingness.md" target="_blank" rel="noopener">Investigate missingness&lt;/a> before choosing a correction.&lt;/p>
&lt;h2 id="documentation-and-resources">Documentation and resources&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>&lt;a href="https://github.com/dvbn/cdid/blob/main/docs/get-started.md" target="_blank" rel="noopener">Getting started&lt;/a>:&lt;/strong> estimation, summaries, aggregation, plotting, and export.&lt;/li>
&lt;li>&lt;strong>&lt;a href="https://github.com/dvbn/cdid/blob/main/docs/from-did.md" target="_blank" rel="noopener">Moving from did&lt;/a>:&lt;/strong> familiar interfaces, changed defaults, and how to compare results.&lt;/li>
&lt;li>&lt;strong>&lt;a href="https://github.com/dvbn/cdid/blob/main/docs/README.md" target="_blank" rel="noopener">Full user guide&lt;/a>:&lt;/strong> a 20-step path through methods and examples.&lt;/li>
&lt;li>&lt;strong>&lt;a href="https://github.com/dvbn/cdid/blob/main/notebooks/README.md" target="_blank" rel="noopener">Practical notebook&lt;/a>:&lt;/strong> editable Quarto code and a downloadable HTML walkthrough with tables and plots.&lt;/li>
&lt;li>&lt;strong>&lt;a href="https://cran.r-project.org/package=cdid" target="_blank" rel="noopener">CRAN manual and vignette&lt;/a>:&lt;/strong> release documentation and installation.&lt;/li>
&lt;li>&lt;strong>&lt;a href="https://github.com/dvbn/cdid/issues" target="_blank" rel="noopener">Questions and bug reports&lt;/a>:&lt;/strong> include the package version and a reproducible example.&lt;/li>
&lt;/ul>
&lt;p>The &lt;a href="https://www.davidbenatia.com/post/cdid-library/">original 2024 blog post&lt;/a> and &lt;a href="https://www.davidbenatia.com/cdid_package_V1.html">original tutorial&lt;/a> remain available as historical introductions. Use the current guide for the released API and methodological extensions.&lt;/p>
&lt;h2 id="reference">Reference&lt;/h2>
&lt;p>Bellégo, C., Benatia, D., and Dortet-Bernadet, V. (2025). &lt;a href="https://doi.org/10.1016/j.jeconom.2024.105783" target="_blank" rel="noopener">The Chained Difference-in-Differences&lt;/a>. &lt;em>Journal of Econometrics&lt;/em>, 248, article 105783. &lt;a href="https://arxiv.org/abs/2301.01085" target="_blank" rel="noopener">Working-paper version&lt;/a>.&lt;/p></description></item></channel></rss>