xuyiqing / gsynth

Generalized Synthetic Control Method
Other
131 stars 40 forks source link

"index" option misspecified #74

Closed cjing1 closed 2 years ago

cjing1 commented 2 years ago

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 commented 2 years ago

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 https://github.com/xuyiqing/gsynth/issues/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/

cjing1 commented 2 years ago

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 commented 2 years ago

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. … <#m7205625604467804619> 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 https://github.com/xuyiqing/gsynth/issues/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 https://github.com/xuyiqing/gsynth/issues/74#issuecomment-1005076864, 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/

cjing1 commented 2 years ago

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. … <#m7205625604467804619> 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.