Package: did2s 1.2.1

did2s: Two-Stage Difference-in-Differences Following Gardner (2021)

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.

Authors:Kyle Butts [aut, cre], John Gardner [aut], Grant McDermott [ctb], Laurent Berge [ctb]

did2s_1.2.1.tar.gz
did2s_1.2.1.zip(r-4.7)did2s_1.2.1.zip(r-4.6)did2s_1.2.1.zip(r-4.5)
did2s_1.2.1.tgz(r-4.6-any)did2s_1.2.1.tgz(r-4.5-any)
did2s_1.2.1.tar.gz(r-4.7-any)did2s_1.2.1.tar.gz(r-4.6-any)
did2s_1.2.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
did2s/json (API)
NEWS

# Install 'did2s' in R:
install.packages('did2s', repos = c('https://kylebutts.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/kylebutts/did2s/issues

Pkgdown/docs site:https://kylebutts.github.io

Datasets:
  • castle - Data from Cheng and Hoekstra
  • df_het - Simulated data with two treatment groups and heterogenous effects
  • df_hom - Simulated data with two treatment groups and homogenous effects

On CRAN:

Conda:

8.96 score 111 stars 331 scripts 2.0k downloads 6 exports 83 dependencies

Last updated from:cde84687ae. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK242
source / vignettesOK338
linux-release-x86_64OK216
macos-release-arm64OK109
macos-oldrel-arm64OK138
windows-develOK133
windows-releaseOK135
windows-oldrelOK121
wasm-releaseOK172

Exports:did2sevent_studygen_dataget_honestdid_obj_did2shonest_did_did2splot_event_study

Dependencies:alabamabackportsBHbigmemorybigmemory.sriBMiscbootbroomcheckmateclarabelclicodetoolscpp11CVXRdata.tablediddidimputationdplyrDRDIDdreamerrECOSolveRfarverfastglmfixestforeachFormulagenericsggplot2gluegmpgtablehighsHonestDiDisobanditeratorslabelinglatex2explatticelifecyclelpSolveAPImagrittrMASSMatrixmatrixStatsmvtnormnleqslvnlmenumDerivosqppbapplypillarpkgconfigpracmapurrrqrngR6RColorBrewerRcppRcppArmadilloRcppEigenRglpkrlangS7sandwichscalesscsslamspacefillrstaggeredstringistringmagicstringrtibbletidyrtidyselectTruncatedNormaltrustutf8uuidvctrsviridisLitewithrzoo

Two-Stage Difference-in-Differences

Rendered fromTwo-Stage-Difference-in-Differences.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2026-06-12
Started: 2021-06-02