Skip to content

NonlinearDiD

0.2.0Package record

Staggered Difference-in-Differences with Nonlinear Outcomes

0packages depend
1.6Kdownloads / year
37.3%test coverage
13/13flavors OK

Overview

About

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.

Changes in 0.2.0
  • Added support for repeated cross-section staggered DiD designs.
  • Added data_type = "panel" and data_type = "repeated_cross_section" options.
  • Made idname optional 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::vcovCL when cluster_var is supplied, sandwich::vcovHC (HC1) otherwise. Panel SEs continue to use the influence-function approach from v0.1.0; set boot = TRUE for fully clustered panel inference.
  • The bootstrap automatically resamples whole clusters when cluster_var is provided, units when data_type = "panel", or individual rows when data_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

CRAN checks
13OK
Slowest check: 2.7 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-09-08
  • ERROR12 OK, 1 ERROR2026-09-07
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK7 OK2026-05-06
Advisories

none known

Documentation

In release 0.2.0
READMEYes · 771 wordsVignettesNoNEWSYes · 100% structured · mentions 0.2.0Citation fileNoWebsitenot declared in DESCRIPTION
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

1.6K
CRAN downloads in the past year
Rank #16,283 · ~4/day · ~135/mo
Daily download trend is not available in this view yet.
28530 days
76090 days
1.6K1 year
Compare downloads with other packages →
Also on129 r2u2 autocran

Repository

Moved from causalfragility-lab/nonlineardid.

2Stars
0Forks
1Open issues
0Open PRs
1Releases
12Commits
1Commit identities
12 commits · Last activity 2026-05-21 · +100% stars, 30d
Responsiveness
not measured

Stars over time

2026-07-14 · 02026-09-30 · 2
PracticesBeta

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.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Reproducibility and dev environment (2)
data-raw/Makefile
CRAN release process (1)
cran-comments.md
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v3 (2026-09-26)

Dependencies

Declared dependencies
9 external dependencies (excludes base and recommended)

Installing NonlinearDiD adds 20 packages (9 with compiled code, 16 MB of source tarballs). Heaviest: ggplot2 6.0 MB, isoband 1.5 MB, sandwich 1.4 MB.

Depends (1)
R >= 4.0.0
Imports (6)
statsutilsMASSsandwichlmtestggplot2
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (1)
Author, Maintainer since 0.1.0 (2026)
Releases (2)

Pick two releases to compare their code metrics.

  • 0.2.0Latest
    record
    2026-05-20 · current release · diff ↗ ·
    added 1 export
    sim_binary_rcs
  • 0.1.0
    record
    2026-05-05
  • R
    R 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")
Hait, S. (2026). NonlinearDiD: Staggered Difference-in-Differences with Nonlinear Outcomes (Version 0.2.0) [Computer software]. https://doi.org/10.32614/CRAN.package.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.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for NonlinearDiD version 0.2.0 [Data set]. HJJB, LLC. Data release v2026-10-20. https://doi.org/10.5281/zenodo.21843040

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.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy