Skip to content
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

"index" option misspecified #74

Closed
cjing1 opened this issue Jan 4, 2022 · 4 comments
Closed

"index" option misspecified #74

cjing1 opened this issue Jan 4, 2022 · 4 comments

Comments

@cjing1
Copy link

cjing1 commented Jan 4, 2022

Hi Yiqing,

Thank you for the great package.

I am trying to run gsynth() function on my own data, gsynth(event_sum_vader_com ~ Treated + Response, data = dat, index = c("ID","Eventday"), se = TRUE, inference = "parametric", r = c(0, 5), CV = TRUE, force = "two-way", parallel = TRUE, min.T0 = 8, nboots = 1000, seed = 02139)

but keep getting the following error:
Error in gsynth.default(formula = NULL, data = data, Y = Yname, D = Dname, : "index" option misspecified. Try, for example, index = c("unit.id", "time").

The panelView function works fine with the same index, and the plot is following:
Screen Shot 2022-01-04 at 12 29 56 PM

Would you mind helping me know what's wrong with my setting of gsynth() function? Thank you.

@xuyiqing
Copy link
Owner

xuyiqing commented Jan 4, 2022 via email

@cjing1
Copy link
Author

cjing1 commented Jan 4, 2022

Interesting. Have you tried making them a factorial or character variable? I saw decimal points in your "ID" and thought it may be the problem.

On Tue, Jan 4, 2022 at 9:32 AM ChenJ @.> wrote: Hi Yiqing, Thank you for the great package. I am trying to run gsynth() function on my own data, gsynth(event_sum_vader_com ~ Treated + Response, data = dat, index = c("ID","Eventday"), se = TRUE, inference = "parametric", r = c(0, 5), CV = TRUE, force = "two-way", parallel = TRUE, min.T0 = 8, nboots = 1000, seed = 02139) but keep getting the following error: Error in gsynth.default(formula = NULL, data = data, Y = Yname, D = Dname, : "index" option misspecified. Try, for example, index = c("unit.id", "time"). The panelView function works fine with the same index, and the plot is following: [image: Screen Shot 2022-01-04 at 12 29 56 PM] https://user-images.githubusercontent.com/31779053/148099618-fbf84ff1-c616-4ce6-a54c-3830a51539e0.png Would you mind helping me know what's wrong with my setting of gsynth() function? Thank you. — Reply to this email directly, view it on GitHub <#74>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2PKGADEG2XJI457FMISPTUUMVKPANCNFSM5LH7JCRQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you are subscribed to this thread.Message ID: @.>
-- Yiqing Xu Assistant Professor Department of Political Science Stanford University https://yiqingxu.org/

Thank you for the quick reply.
Yes, I tried to make ID character variable from 1,2,etc to event1, event2, etc. But it does not work.

@xuyiqing
Copy link
Owner

xuyiqing commented Jan 4, 2022 via email

@cjing1
Copy link
Author

cjing1 commented Jan 4, 2022

Please send us an example code and data file vie email -- I assume you're using the most up-to-date version of the package.

On Tue, Jan 4, 2022 at 10:43 AM ChenJ @.> wrote: Interesting. Have you tried making them a factorial or character variable? I saw decimal points in your "ID" and thought it may be the problem. … <#m_7205625604467804619_> On Tue, Jan 4, 2022 at 9:32 AM ChenJ @.> wrote: Hi Yiqing, Thank you for the great package. I am trying to run gsynth() function on my own data, gsynth(event_sum_vader_com ~ Treated + Response, data = dat, index = c("ID","Eventday"), se = TRUE, inference = "parametric", r = c(0, 5), CV = TRUE, force = "two-way", parallel = TRUE, min.T0 = 8, nboots = 1000, seed = 02139) but keep getting the following error: Error in gsynth.default(formula = NULL, data = data, Y = Yname, D = Dname, : "index" option misspecified. Try, for example, index = c("unit.id http://unit.id", "time"). The panelView function works fine with the same index, and the plot is following: [image: Screen Shot 2022-01-04 at 12 29 56 PM] https://user-images.githubusercontent.com/31779053/148099618-fbf84ff1-c616-4ce6-a54c-3830a51539e0.png https://user-images.githubusercontent.com/31779053/148099618-fbf84ff1-c616-4ce6-a54c-3830a51539e0.png Would you mind helping me know what's wrong with my setting of gsynth() function? Thank you. — Reply to this email directly, view it on GitHub <#74 <#74>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2PKGADEG2XJI457FMISPTUUMVKPANCNFSM5LH7JCRQ https://github.com/notifications/unsubscribe-auth/AB2PKGADEG2XJI457FMISPTUUMVKPANCNFSM5LH7JCRQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you are subscribed to this thread.Message ID: @.> -- Yiqing Xu Assistant Professor Department of Political Science Stanford University https://yiqingxu.org/ Thank you for the quick reply. Yes, I tried to make ID character variable from 1,2,etc to event1, event2, etc. But it does not work. — Reply to this email directly, view it on GitHub <#74 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2PKGC2G5P4WYU2ZSKXVMLUUM5U3ANCNFSM5LH7JCRQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you commented.Message ID: @.**>
-- Yiqing Xu Assistant Professor Department of Political Science Stanford University https://yiqingxu.org/

Thank you so much for your help. I found and solved the error, I accidentally created duplicated variables.
Thank you again for this amazing package. I appreciate it.

@cjing1 cjing1 closed this as completed Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants