Closed etiennebacher closed 2 years ago
I think the problem comes from the following lines in synthetic_control.data.frame()
:
The problem is the break
call in the for
loop because it assumes that the treated unit comes first in the data. This is not true because before the loop you arrange by iso
and then by placebo
value, whereas it should be by placebo
value first (so that the treated country comes first) and then by iso
.
Bottom line, I think the fix should be to replace:
https://github.com/edunford/tidysynth/blob/afd112a57f9716bf649f98ebb1dab68d66e9da00/R/main.R#L216
by dplyr::arrange(placebo, !!unit) %>%
Hello, I think I found a bug that is present on the Github version but not on CRAN version. When I use
generate_placebos = FALSE
insynthetic_control()
, then most of thegrab_
andplot_
functions don't work:Created on 2022-08-31 by the reprex package (v2.0.1)
Everything works correctly if
generate_placebos = TRUE
but it makes the function slower and placebos shouldn't be needed for these functions.Besides this bug, even the output of
generate_control()
seems weird whengenerate_placebos = FALSE
:Created on 2022-08-31 by the reprex package (v2.0.1) Can you confirm that it works as expected?