jepusto / clubSandwich

Cluster-robust (sandwich) variance estimators with small-sample corrections
http://jepusto.github.io/clubSandwich/
47 stars 8 forks source link

Deactivate test (or test for now correct) plm::vcovHC for FD models with clustering on time dimension #84

Closed tappek closed 2 years ago

tappek commented 2 years ago

I have recently fixed a long-standing bug in plm::vcovHC for first-difference models when clustering on the time dimension (issue is recorded here: https://github.com/jepusto/clubSandwich/issues/13#issuecomment-237741741, and the commit to fixing it in plm is https://github.com/ycroissant/plm/commit/2ab514bf165cca22d886ee234f088e2ddca66d86).

I checked and plm development version now matches clubSandwich for this specific situation. I was about to release a new version of plm but luckily ran reverse dependency checks and noticed that one of clubSandwich's tests now fail with the plm version as in the development repository; it is one in test_plm-first-differences.R.

It seems like you may have tailored a part of clubSandwich's test for this to match plm's baloney result for FD models when clustering on time. So, the fixed plm version breaks clubSandwich's tests suite... It is the test from this line onwards https://github.com/jepusto/clubSandwich/blob/f960eaecd0d5921b8323b23dff6db3f594d69e76/tests/testthat/test_plm-first-differences.R#L51 baloney <- tcrossprod(estmats[,-6])

We would need to align CRAN releases of plm and clubSandwich to not break CRAN tests. I see two options: a) release a clubSandwich version with this test temporarily deactivated before a new release of plm (and in the clubSandwich version after that bring in a test that compares plm::vcovHC to clubSandwich::vcovCR (clubSandwich::vcovCR(plm_FD, type = "CR0", cluster = "time") vs. plm::vcovHC(plm_FD, method="arellano", type = "HC0", cluster = "time")) b) when releasing the fixed plm version to CRAN, inform CRAN that an adapted clubSandwich version will follow in due course

Maybe you have planned for a new clubSandwich version on CRAN anytime soon?