Staggered Difference-in-Differences with Nonlinear Outcomes
Overview
Supports staggered difference-in-differences designs with nonlinear outcomes for both panel and repeated cross-section data. Implements estimators for staggered treatment adoption with binary, count, and other nonlinear outcomes, extending Callaway and Sant'Anna (2021) doi:10.1016/j.jeconom.2020.12.001 to settings with nonlinear outcome models such as logit, probit, and Poisson. For panel data, units are followed over time and 'idname' identifies repeated observations. For repeated cross-section data, observations are independent within each time period; 'idname' is optional and may identify survey records or households, but the estimator does not require the same units to appear across periods. Repeated cross-section estimation includes pooled quasi-maximum likelihood approaches motivated by Wooldridge (2023) doi:10.1093/ectj/utad016, with optional weighting and clustered inference. Methods also draw on Roth and Sant'Anna (2023) doi:10.3982/ECTA19402 and Sant'Anna and Zhao (2020) doi:10.1016/j.jeconom.2020.06.003.
- Added support for repeated cross-section staggered DiD designs.
- Added
data_type = "panel"anddata_type = "repeated_cross_section"options. - Made
idnameoptional for repeated cross-section designs. - Added support for sampling weights through
weightsname. - Added support for clustered inference through
cluster_var. - Added examples for binary repeated cross-section outcomes with staggered treatment timing.
- Preserved all panel-data functionality from version 0.1.0.
Implementation notes
- Repeated cross-section ATT(g,t) uses the Wooldridge (2023) pooled QMLE with a treatment-by-period interaction. The doubly-robust variant augments this with inverse probability weighting on the estimated propensity score.
Show all changes in 0.2.0Hide the rest of the changes in 0.2.0
- Sampling weights (when supplied via
weightsname) are used throughout: the outcome regression, the propensity score model, and the pooled QMLE. They are multiplied with the IPW factor in the doubly-robust path. - Analytical SEs for the RCS path use
sandwich::vcovCLwhencluster_varis supplied,sandwich::vcovHC(HC1) otherwise. Panel SEs continue to use the influence-function approach from v0.1.0; setboot = TRUEfor fully clustered panel inference. - The bootstrap automatically resamples whole clusters when
cluster_varis provided, units whendata_type = "panel", or individual rows whendata_type = "repeated_cross_section"without clustering. - The compiled C++ helpers from v0.1.0 have been replaced with equivalent pure-R implementations, eliminating the Rcpp dependency. The package no longer requires compilation.
Bug fixes
- None.
---
From NEWS.md in the release
Install
Health
- OK13 OK2026-09-08
- ERROR12 OK, 1 ERROR2026-09-07
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK7 OK2026-05-06
Documentation
- Help pages
- 17 (1 internal)includes a package overview page
- Examples that run
- 83%10 run in a plain check · 2 only when donttest examples are enabled (R CMD check --as-cran)
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 24%
Downloads
Repository
Moved from causalfragility-lab/nonlineardid.
Stars over time
Issues over time
6 development-tooling and community-health practices detected across 4 families in the upstream repository
Checks run against github.com/causalfragility-lab/nonlineardid on 2026-10-18.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Dependencies
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 0.2.0Latest
- 0.1.02026-05-05
- RR 4.6.0 released · 2026-04-24
Package metadata
- First published
- 2026-05-05
- Total releases
- 2 / 1 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.0.0
- Download size
- 38 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("NonlinearDiD")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-20, which the citation names so these numbers can be found later. More on citing and the projects behind them.