xuyiqing / fect

fixed effect counterfactual estimators
Other
53 stars 20 forks source link

Strange error caused by units with few pre-treatment observations #14

Closed ccepeda10 closed 3 years ago

ccepeda10 commented 3 years ago

Hi. I was trying to use the package with the "mc" estimator but I get repeated errors saying that: Error in fect.cv(Y = Y, X = X, D = D, I = I, II = II, T.on = T.on, T.off = T.off, : Some units have too few pre-treatment observations. Try to remove them.

I've tried to remove all units with fewer than 10 pre-treatment periods but the problem persist. I also tried to estimate it with the latest version of gsynth and I also ran into similar problems. Extrangely enough, the 1.09 version of gsynth available in CRAN doesn't have the same problems when not using covariates. It still gives problems when using them though. As eliminating the units with few pre-treatment periods does not solve the problem, the root cause seems to be something else, but I'm not able to deduce what could be causing this.

Thanks in advance!

xuyiqing commented 3 years ago

Would you mind drawing a treatment status plot using the panelView package?

Otherwise, please send us (emails below) sample code and data files for us to replicate your error. Thank you!

@. @.

On Mon, Apr 5, 2021 at 12:55 PM ccepeda10 @.***> wrote:

Hi. I was trying to use the package with the "mc" estimator but I get repeated errors saying that: Error in fect.cv(Y = Y, X = X, D = D, I = I, II = II, T.on = T.on, T.off = T.off, : Some units have too few pre-treatment observations. Try to remove them.

I've tried to remove all units with fewer than 10 pre-treatment periods but the problem persist. I also tried to estimate it with the latest version of gsynth and I also ran into similar problems. Extrangely enough, the 1.09 version of gsynth available in CRAN doesn't have the same problems when not using covariates. It still gives problems when using them though. As eliminating the units with few pre-treatment periods does not solve the problem, the root cause seems to be something else, but I'm not able to deduce what could be causing this.

Thanks in advance!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/xuyiqing/fect/issues/14, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2PKGHJVDX6WDSCVFGXMATTHIPTHANCNFSM42NLSNAA .

ccepeda10 commented 3 years ago

Thanks, I wasn't expecting such a quick response. Here is the view of the panel. I'd be happy to mail you the code and data, but the emails appear to be 'censored'. They show like this ***@***.***.

Is there any other way to send you the samples? imagen

xuyiqing commented 3 years ago

Hah, sorry. You can find my work email in my profile or on this page: http://yiqingxu.org/software/fect/fect.html

On Mon, Apr 5, 2021 at 2:27 PM ccepeda10 @.***> wrote:

Thanks, I wasn't expecting such a quick response. Here is the view of the panel. I'd be happy to mail you the code and data, but the emails appear to be 'censored'. They show like this @.***.

Is there any other way to send you the samples? [image: imagen] https://user-images.githubusercontent.com/47113950/113628915-3dd40f80-962b-11eb-8abc-7fa1c3f1549e.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/xuyiqing/fect/issues/14#issuecomment-813660997, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2PKGBCPLTOSQYVGDSLKD3THI2O5ANCNFSM42NLSNAA .

-- Yiqing Xu

Assistant Professor Department of Political Science University of California, San Diego http://yiqingxu.org/

ccepeda10 commented 3 years ago

I sent you the data and code. Thanks for your help!