Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

universal as base_period for data with gap years #185

Open
XiangShawnZhang opened this issue Oct 30, 2023 · 1 comment
Open

universal as base_period for data with gap years #185

XiangShawnZhang opened this issue Oct 30, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@XiangShawnZhang
Copy link

This is a problem that I have discussed with Brant via Email. I want to leave the emails between us as an issue here and hope this can be addressed in the near future.

Question: The aggregation of the dynamic treatment effects works well on the base_period = "varying"; When I change the option of base_period = “universal”, the att_gt works; but when it aggregates to the dynamic treatment effects, it reports error of “Error in inffunc1[, whichones] %*% weights.agg : invalid object passed to as_cholmod_sparse”

Exp_CSDID <- did::att_gt(yname = "share_income",
gname = "T_Timing",
idname = "id",
tname = "year",
xformla = ~ NULL,
data = Expenditure,
allow_unbalanced_panel = T,
control_group = "notyettreated",
base_period = "universal",
clustervars = "ID_VILLAGE")

  dynamic_base <- did::aggte(Exp_CSDID, type = "dynamic")
  **Error in inffunc1[, whichones] %*% weights.agg : invalid object passed to as_cholmod_sparse**

Brant's reply: Thanks for the message. This is a surprising issue to me --- I expect them to work in the same cases. If you look at the ATT(g,t)'s themselves, are there any differences in terms of which ones are computed?

My reply: Please see the att_gt() results below.
image

Brant's reply: Yes, this is helpful. It looks like the year 2020 is not included in your data (is that correct?). I'm guessing that is the source of the issues here. I suspect that this is an actual bug in our code (though note that this is a pretty hard case as "event time" is rather complicated here). I can add this as an issue on GitHub, but it may take a while for us to fully resolve this.

@bcallaway11
Copy link
Owner

Got it, thanks!

@bcallaway11 bcallaway11 added the bug Something isn't working label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants