Two-Stage Difference-in-Differences Following Gardner (2021)
Overview
Estimates Two-way Fixed Effects difference-in-differences/event-study models using the approach proposed by Gardner (2021) doi:10.48550/arXiv.2207.05943. To avoid the problems caused by OLS estimation of the Two-way Fixed Effects model, this function first estimates the fixed effects and covariates using untreated observations and then in a second stage, estimates the treatment effects.
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- OK13 OK2026-05-02
Show 2 earlier changesHide 2 earlier changes
- ERROR11 OK, 1 ERROR2026-04-25
- OK14 OK2026-03-10
Documentation
- Help pages
- 9
- Examples that run
- 50%1 run in a plain check · 1 only when donttest examples are enabled (R CMD check --as-cran)
- Exported functions with examples
- 40%
- Documented parameters
- 100%
- Return-value docs
- 80%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 70%
- Median days to close, 50 most recently updated closed issues
- 1
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Issues over time
PRs over time
Commits over time
6 development-tooling and community-health practices detected across 4 families in the upstream repository
Checks run against github.com/kylebutts/did2s on 2026-10-11.
GitHub Pages site last deployed 2026-09-20
pkgdown site last built 2023-03-28, before release 1.2.1 (2026-03-05)
Dependencies
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- 1.2.1Latest
- 1.2.0
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- 1.0.22023-04-07 · diff ↗
- 1.0.12023-03-28 · diff ↗
- 1.0.02023-03-11 · diff ↗
- unarchivedReturned to CRAN2022-07-21
- 0.7.02022-07-21 · diff ↗
- archivedRemoved from CRAN2022-07-09requires archived package 'did'
- RR 4.2.0 released · 2022-04-22
- 0.6.0
- 0.4.02021-09-27
- RR 4.1.0 released · 2021-05-18
Package metadata
- First published
- 2021-09-27
- Total releases
- 8 / 5 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 3.5.0
- Bundled data
- 1.5 MB / 3 files
- Download size
- 3.3 MB
Cite
Cite this package
Run in R for the authors' entry:
citation("did2s")The package provides a citation file, so citation() returns the authors' own entry.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.