synth-inference/synthdid

1 treatment group and 2 control groups - error for vcov(tau.hat, method='placebo'): dim(X) must have a positive length

NN-528 opened this issue · 0 comments

First, thank you for maintaining this amazing library.

Second, here the issue I encounter: I have 1 treatment group and 2 control groups (and 30 time periods for each).
When trying to obtain the SE using the command se = sqrt(vcov(tau.hat, method='placebo')), I get the following error message:
Error in apply(Y, 2, function(col) { : dim(X) must have a positive length

If I am not mistaken, it seems that the following line of the placebo_se() function creates the error:
do.call(synthdid_estimate, c(list(Y=setup$Y[ind,], N0=N0, T0=setup$T0, X=setup$X[ind, ,], weights=weights.boot), opts))

When I check the dimensions of setup$X[ind, ,], I get the following:
<2 x 30 x 0 array of logical>

Wonder whether is could be related to something like this?
https://stackoverflow.com/questions/28423275/dimx-must-have-a-positive-length-when-applying-function-in-data-frame

BTW: I know that the placebo SE with 2 controls will result in the same replications and always draw the same two controls, but would be great to still have the code run.