-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error occurred at simulating error step #43
Comments
Could you send me a sample data and code file such that we can replicate
the error?
I believe we do have a built-in "id" option to accommodate your needs.
Best,
Yiqing
…On Thu, Jun 25, 2020 at 7:13 AM deedeewoo ***@***.***> wrote:
Hi,
We ran into the following error with some of our gsynth model:
Simulating errors ...Error in { : task 602 failed - "'data' must be of a
vector type, was 'NULL'"
In our study, we have lots of treated units with varying treatment timing.
So we just tried to run gsynth on the entire dataset and a subset only with
treated units at a certain period. The error only occurs when using the
subset (the 2nd model in the sample code).
I also attached the sample data & code to reproduce the error. The code:
test1 <- readRDS("tmpdata/testdata.RDS")
out1 <- gsynth(dv1 ~ treatment + covar1 + covar2 + covar3 + covar4 +
covar5 + covar6, data = test1, index = c("id", "TimePeriod"), na.rm = TRUE,
force = "two-way", CV = TRUE, r = c(0,5), se = TRUE, inference =
"nonparametric", min.T0 = 7, seed = 1, nboots = 1000, parallel = TRUE,
cores = 4)
test2 <- test1 %>% group_by(id) %>% mutate(check = sum(treatment)) %>%
ungroup() %>% filter(check == 7 | check == 0) %>% select(-check)
out2 <- gsynth(dv1 ~ treatment + covar1 + covar2 + covar3 + covar4 +
covar5 + covar6, data = test2, index = c("id", "TimePeriod"), na.rm = TRUE,
force = "two-way", CV = TRUE, r = c(0,5), se = TRUE, inference =
"parametric", min.T0 = 7, seed = 1, nboots = 1000, parallel = TRUE, cores =
4)
I found the error seems to be related to a particular covariate and random
number generator: when I remove "covar6" from the model, the error
disappears, and also I ran multiple times, sometimes it went through...
Also, I'm on PC Windows 10 with R version is 4.0.0. and gsynth 1.0.9
Many thanks!
Dee
testdata.zip
<https://github.com/xuyiqing/gsynth/files/4831825/testdata.zip>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#43>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB2PKGAB3JKQN2PBZSPIQ3DRYNLPJANCNFSM4OINGTNA>
.
--
Yiqing Xu
Assistant Professor
Department of Political Science
Stanford University
http://yiqingxu.org/
|
Hi Professor, Thanks for your prompt reply! Here is the sample data & code: We did use the 'id' option when plotting individual unit's "actual vs. synthetic control trajectory", but the results (the trajectory of synthetic control) of some units are not the same from the 1st & 2nd model in the attached code. Thanks! |
Hi Dee, |
Hi, just download the latest version, and it works now. |
Hi,
We ran into the following error with some of our gsynth model:
Simulating errors ...Error in { : task 602 failed - "'data' must be of a vector type, was 'NULL'"
In our study, we have lots of treated units with varying treatment timing. So we just tried to run gsynth on the entire dataset and a subset only with treated units at a certain period. The error only occurs when using the subset (the 2nd model in the sample code).
I also attached the sample data & code to reproduce the error. The code:
test1 <- readRDS("tmpdata/testdata.RDS")
out1 <- gsynth(dv1 ~ treatment + covar1 + covar2 + covar3 + covar4 + covar5 + covar6, data = test1, index = c("id", "TimePeriod"), na.rm = TRUE, force = "two-way", CV = TRUE, r = c(0,5), se = TRUE, inference = "nonparametric", min.T0 = 7, seed = 1, nboots = 1000, parallel = TRUE, cores = 4)
test2 <- test1 %>% group_by(id) %>% mutate(check = sum(treatment)) %>% ungroup() %>% filter(check == 7 | check == 0) %>% select(-check)
out2 <- gsynth(dv1 ~ treatment + covar1 + covar2 + covar3 + covar4 + covar5 + covar6, data = test2, index = c("id", "TimePeriod"), na.rm = TRUE, force = "two-way", CV = TRUE, r = c(0,5), se = TRUE, inference = "parametric", min.T0 = 7, seed = 1, nboots = 1000, parallel = TRUE, cores = 4)
I found the error seems to be related to a particular covariate and random number generator: when I remove "covar6" from the model, the error disappears, and also I ran multiple times, sometimes it went through...
Also, I'm on PC Windows 10 with R version is 4.0.0. and gsynth 1.0.9
Many thanks!
Dee
testdata.zip
The text was updated successfully, but these errors were encountered: