MatthieuStigler / multiDiff

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

test_event fails when not enough pre period #24

Open MatthieuStigler opened 1 year ago

MatthieuStigler commented 1 year ago
library(multiDiff)
mdd_data <- sim_dat_common(Time=2, timing_treatment = 2, as_mdd = TRUE)
mdd_test_pre_trend_event(mdd_dat=mdd_data)
#> Error in `[<-`(`*tmp*`, i, which(which_before)[i], value = 1): subscript out of bounds
mdd_test_pre_trend_means(mdd_dat=mdd_data)
#> # A tibble: 2 × 5
#>   test       coefficient statistic p.value term                                 
#>   <chr>            <dbl>     <dbl>   <dbl> <chr>                                
#> 1 test_joint     NA         0.0198   0.888 " = period1:treatcontrol - period1:t…
#> 2 test_indiv      0.0149    0.0198   0.888 "- period1:treatcontrol + period1:tr…

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