Skip to content

did

Treatment Effects with Multiple Periods and Groups

v2.3.0 · Dec 12, 2025 · GPL-2

Description

The standard Difference-in-Differences (DID) setup involves two periods and two groups -- a treated group and untreated group. Many applications of DID methods involve more than two periods and have individuals that are treated at different points in time. This package contains tools for computing average treatment effect parameters in Difference in Differences setups with more than two periods and with variation in treatment timing using the methods developed in Callaway and Sant'Anna (2021) <doi:10.1016/j.jeconom.2020.12.001>. The main parameters are group-time average treatment effects which are the average treatment effect for a particular group at a a particular time. These can be aggregated into a fewer number of treatment effect parameters, and the package deals with the cases where there is selective treatment timing, dynamic treatment effects, calendar time effects, or combinations of these. There are also functions for testing the Difference in Differences assumption, and plotting group-time average treatment effects.

Downloads

9.9K

Last 30 days

1236th

28.3K

Last 90 days

126.9K

Last year

Trend: +5% (30d vs prior 30d)

CRAN Check Status

14 OK
Show all 14 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-macos-arm64 OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Reverse Dependencies (10)

imports

Dependency Network

Dependencies Reverse dependencies BMisc Matrix pbapply ggplot2 DRDID generics tidyr fastglm data.table dreamerr cdid did2s optic etwfe fastdid fect fetwfe modelsummary parameters ptetools did

Version History

new 2.3.0 Mar 10, 2026
updated 2.3.0 ← 2.1.2 diff Dec 12, 2025
updated 2.1.2 ← 2.1.1 diff Jul 19, 2022
updated 2.1.1 ← 2.1.0 diff Jan 26, 2022
updated 2.1.0 ← 2.0.0 diff Dec 9, 2021
updated 2.0.0 ← 1.2.3 diff Dec 10, 2020
updated 1.2.3 ← 1.2.2 diff Feb 17, 2020
updated 1.2.2 ← 1.2.1 diff Jun 20, 2019
updated 1.2.1 ← 1.2.0 diff Jun 13, 2019
updated 1.2.0 ← 1.1.2 diff Oct 16, 2018
updated 1.1.2 ← 1.1.0 diff Sep 10, 2018
updated 1.1.0 ← 1.0.0 diff Jul 10, 2018
new 1.0.0 Apr 2, 2018