Package: phdid 0.1.0
phdid: Partial Homogeneity in Staggered Difference-in-Differences
In staggered difference-in-differences designs the treatment effect is a vector of cohort-time effects rather than a single number. Estimating each separately is unbiased but imprecise when some are equal, while pooling them all is precise but biased under genuine heterogeneity. This package treats the choice as a partition-selection problem on the cohort-time cells and provides two estimators for it: a Dirichlet process mixture fitted by a collapsed Gibbs sampler, whose posterior marginalises over the unknown partition and reports co-clustering probabilities, and an 'L0'-penalised estimator that returns a single partition and arises as the fixed-variance maximum a posteriori solution of the same model. Also provides tests for whether the cohort-time effects carry recoverable heterogeneity at all, sampler diagnostics including exact enumeration of the partition posterior for small designs, regularisation paths for both estimators, and a calibrated data-generating process. All estimators accept a vector of first-stage cohort-time effects with their joint covariance, so any heterogeneity-robust first-stage estimator may be used. Methods are described in Arora and Wagle (2026) <doi:10.2139/ssrn.7207083>.
Authors:
phdid_0.1.0.tar.gz
phdid_0.1.0.zip(r-4.7-any)phdid_0.1.0.zip(r-4.6-any)phdid_0.1.0.zip(r-4.5-any)
phdid_0.1.0.tgz(r-4.6-any)phdid_0.1.0.tgz(r-4.5-any)
phdid_0.1.0.tar.gz(r-4.7-any)phdid_0.1.0.tar.gz(r-4.6-any)
phdid_0.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
phdid/json (API)
| # Install 'phdid' in R: |
| install.packages('phdid', repos = c('https://ronwag2005.r-universe.dev', 'https://cloud.r-project.org')) |
Bug tracker:https://github.com/ronwag2005/phdid/issues
Last updated from:3f3733927f. Checks:9 OK. Indexed: yes.
| Target | Result | Time | Files | Syslog |
|---|---|---|---|---|
| linux-devel | OK | 179 | ||
| source / vignettes | OK | 268 | ||
| linux-release | OK | 141 | ||
| macos-release | OK | 225 | ||
| macos-oldrel | OK | 197 | ||
| windows-devel | OK | 181 | ||
| windows-release | OK | 103 | ||
| windows-oldrel | OK | 150 | ||
| wasm-release | OK | 103 |
Exports:adjusted_randalpha_for_groupsalpha_sensitivitybayes_phcoclusteringcovariance_checkenumerate_partitionsexpected_groupsflex_twfehomogeneity_testl0_phlambda_sensitivityph_dataph_designph_fitph_rhatph_sampleph_truthplot_coclusteringplot_l0_pathplot_placebo_bandplot_sensitivityplot_sim_studypoint_partitionpooled_twfesim_study
Dependencies:
Last update: 2026-09-07
Started: 2026-08-16
Last update: 2026-09-07
Started: 2026-08-16
