xuyiqing / gsynth

Generalized Synthetic Control Method
Other
132 stars 40 forks source link

Error when r = 0 : Attempt to set 'rownames' on an object with no dimensions #38

Open michaelstiefel opened 4 years ago

michaelstiefel commented 4 years ago

I am running into the same error message as user fickse here: https://github.com/cran/gsynth/issues/1

When I try to set r = 0 in order to compare gsynth to diff-in-diff or when r is set to zero in the CV-step, I get the error message

Error in rownames<-(*tmp*, value = c(101, 102, 103, 104, 105)) : attempt to set 'rownames' on an object with no dimensions

I am copying fickse's example below:

data(gsynth)

out <- gsynth(Y ~ D + X1 + X2, data = simdata, index = c("id","time"), force = "two-way", CV = FALSE, r = 0, se = TRUE, inference = "parametric", nboots = 1000, parallel = FALSE)
Janlow commented 4 years ago

I am also experiencing this error message when running gsynth and the cross-validation is suggesting r=0. It works when I manually set CV = FALSE and r=2 for example, or when the cross-validation is suggesting r>0. Any suggestions on how to solve this?

This is my error message Error in rownames<-(*tmp*, value = iname[which(out$tr == 1)]) : attempt to set 'rownames' on an object with no dimensions

xuyiqing commented 4 years ago

Thank you for letting us know. We'll look into it. Could you send us a sample dataset that can replicates this error to yiqingxu@stanford.edu and liulch@mit.edu?

On Fri, Apr 17, 2020 at 5:02 AM Janlow notifications@github.com wrote:

I am also experiencing this error message when running gsynth and the cross-validation is suggesting r=0. It works when I manually set CV = FALSE and r=2 for example, or when the cross-validation is suggesting r>0. Any suggestions on how to solve this?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/xuyiqing/gsynth/issues/38#issuecomment-615206732, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2PKGE5ZOKLHKUF3LHHPTTRNBAO3ANCNFSM4KISQ6YA .

-- Yiqing Xu

Assistant Professor Department of Political Science Stanford University http://yiqingxu.org/

Janlow commented 4 years ago

This was already fixed in the latest version found on GitHub, 1.1.6. I only had Cran version 1.0.9 installed. Thank you! This can be closed