Published February 2026 | Version Published
Journal Article Open

didunit: a unit-level multi-period differences-in-differences estimator in R

  • 1. ROR icon California Institute of Technology

Abstract

This R package estimates multi-period differences-in-differences at the level of the treated unit. This allows more flexible aggregation over estimators whose most granular differences-in-differences estimate is at the treated time and is useful in applications where there is considerable heterogeneity within the treated time group or when units treated at the same time receive somewhat different treatments. For example, when units are treated with different doses, they can be aggregated on the basis of dose to derive a dose-response function. Regional heterogeneity, as illustrated by a cross-country study on democratization, is another example. The software's calls have the same syntax as the did package and agree with those estimates when panels are balanced and covariates are not relevant.

Copyright and License

© 2025 The Authors. Published by Elsevier B.V. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/).

Acknowledgement

The authors thank the three anonymous referees who provided valuable feedback.

Contributions

Ransi Clark: Writing – review & editing, Writing – original draft, Visualization, Validation, Software, Formal analysis, Data curation, Conceptualization. Jonathan N. Katz: Writing – review & editing, Supervision, Conceptualization. R. Michael Alvarez: Writing -– review & editing, Supervision, Conceptualization.

Supplemental Material

Download: Download Acrobat PDF file (278KB)

Multimedia Component 1.

Download: Download file (3KB)

Multimedia Component 2.

Download: Download file (2KB)

Multimedia Component 3.

Download: Download file (788B)

Multimedia Component 4.

Download: Download file (8KB)

Multimedia Component 5.

Download: Download file (29KB)

Multimedia Component 6.

Download: Download file (16KB)

Multimedia Component 7.

Download: Download file (16KB)

Multimedia Component 8.

Download: Download file (3KB)

Multimedia Component 9.

Download: Download file (13KB)

Multimedia Component 10.

Download: Download file (3KB)

Multimedia Component 11.

Download: Download file (4KB)

Multimedia Component 12.

Download: Download file (6KB)

Multimedia Component 13.

Download: Download file (5KB)

Multimedia Component 14.

Download: Download file (5KB)

Multimedia Component 15.

Download: Download file (2KB)

Multimedia Component 16.

Download: Download file (2KB)

Multimedia Component 17.

Download: Download file (3KB)

Multimedia Component 18.

Files

1-s2.0-S2352711025004339-main.pdf

Files (2.3 MB)

Name Size
md5:0c3d941a56e7e9e00d3984b443260bce
2.0 MB Preview Download
md5:d2cb6b888e7901e0d188fe67321a4893
312.7 kB Preview Download

Additional details

Dates

Submitted
2025-02-09
Accepted
2025-11-27
Available
2025-12-17
Version of record

Caltech Custom Metadata