MatthieuStigler / multiDiff

Multi-period diff and diff
Other
3 stars 0 forks source link

warning with irregular years: longer object length is not a multiple of shorter object length #14

Closed MatthieuStigler closed 1 year ago

MatthieuStigler commented 1 year ago

Code currently assumes regular years, otherwise throws warning:

> Warning in treated_periods_clean == expected_seq: longer object length is not a

> multiple of shorter object length

library(multiDiff)
dat_DiD_raw <- sim_dat_common()
dat_DiD <- mdd_data_format(subset(dat_DiD_raw, Time !=3))
dat_DiD
#> Warning in treated_periods_clean == expected_seq: longer object length is not a
#> multiple of shorter object length
#> ### MDD data
#>  -Design type:  classical 
#>  -Reversible treatment:  FALSE 
#>  -N units: 1000. Treated: 250
#>  -N treatment sequences:  2 
#>  -T periods: 9. Treated: 8
#>  -Treated periods:  2 4 5 6 7 8 9 10

Created on 2023-07-16 with reprex v2.0.2

MatthieuStigler commented 1 year ago

solved now with https://github.com/MatthieuStigler/multiDiff/commit/de98d3e765052b6c9c79b09a58a9864e28ae6378 and https://github.com/MatthieuStigler/multiDiff/commit/427402762c56f320bbf6967a8b438427565bfc34

library(multiDiff)
packageVersion("multiDiff")
#> [1] '0.3.0'
dat_DiD_raw <- sim_dat_common()
dat_DiD <- mdd_data_format(subset(dat_DiD_raw, Time !=3))
dat_DiD
#> ### MDD data
#>  -Design type:  classical 
#>  -Reversible treatment:  FALSE 
#>  -N units: 1000. Treated: 250
#>  -N treatment sequences:  2 
#>  -T periods: 9. Treated: 8
#>  -Treated periods:  2 4 5 6 7 8 9 10

Created on 2023-10-20 with reprex v2.0.2