bcallaway11 / did

Difference in Differences with Multiple Periods, website: https://bcallaway11.github.io/did
298 stars 95 forks source link

Errors when balancing in event time #127

Closed bcallaway11 closed 2 years ago

bcallaway11 commented 2 years ago

We are getting some unexpected errors (at least I think) in some case (not sure the pattern as I don't always get this) when balancing with respect to event time. Example:

library(did)
data(mpdta)
mw.attgt <- att_gt(yname = "lemp",
                   gname = "first.treat",
                   idname = "countyreal",
                   tname = "year",
                   xformla = ~1,
                   data = mpdta,
)
mw.dyn.balance <- aggte(mw.attgt, type = "dynamic", balance_e=1)
#> Error in rowSums(sapply(keepers, function(k) {: 'x' must be an array of at least two dimensions
bcallaway11 commented 2 years ago

Fixed