Closed avila-a closed 2 years ago
Hi Antonio,
Thanks for the message. It looks like I may have introduced a bug into the conditional_did_pretest
code in the new version. For what it’s worth, my sense is that most researchers who use our package do not actually use this function and find the pre-tests that come directly out of att_gt
to be sufficient (as well as being much less computationally demanding). That said, I’ll try to take a closer look at this issue this week. I’ll keep you posted.
Brant
Many thanks Brant!
Hi Antonio,
Sorry it took me so long to get to this. But I think that I have it working now. I was able to reproduce the same sort of error that you were reporting. But I updated the code, and now it appears to work:
library(did)
# these lines just create simulated data
sp <- reset.sim(time.periods=3, n=1000)
data <- build_sim_dataset(sp)
cdp <- conditional_did_pretest(yname="Y",
tname="period",
idname="id",
gname="G",
xformla=~X,
data=data)
#> We are no longer updating this function. It should continue to work, but most users find the pre-tests already reported by the `att_gt` function to be sufficient for most empirical applications.
#> Step 1 of 2: Computing test statistic....
#> Step 2 of 2: Simulating limiting distribution of test statistic....
summary(cdp)
#> Reference: Callaway, Brantly and Pedro H.C. Sant'Anna. "Difference-in-Differences with Multiple Time Periods." Journal of Econometrics, Vol. 225, No. 2, pp. 200-230, 2021. <https://doi.org/10.1016/j.jeconom.2020.12.001>, <https://arxiv.org/abs/1803.09015>
#> Cramer von Mises:
#> Test Statistic: 4.031258
#> Critical Value: 19.9732
#> P-value : 0.543
#>
#> Clustering on : ,
#> X formula : ~ X
Keep me posted on if this works for you now.
Brant
Hi,
Thank you for your amazing package and the very clear explanations you post here.
I am running on an error that was not there on the last version I had of
did
. The error happened on my specific data but it also happens in the reproducible example fromconditional_did_pretest()
:When I run it, I get the following error message:
I have just installed the newer versions of R and of all packages and dependencies, including
BMisc
. Do you know what causes the error?Thank you and best wishes for the year ahead,
Antonio