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
gsynth fails with "'data' must be of a vector type, was 'NULL''"? when se=TRUE, works otherwise #56
Comments
Hi, I think that the error occurs on bootstrapped samples. Can you send us a dataset that only includes the id, time and treatment variables so we can try replicating the error? Thx! |
Hi again, and sorry for the late reply. Here is a google drive link containing the exact rdata file I've used, if you prefer I send it to you by other means then please let me know. Also, for what it's worth, adding more countries(units, but not increasing the time scope) seemed to resolve the issue. |
Thank you for the data. Will check it and reply to you. |
Hi @simenfuglestad, have you tried the GitHub version? I tried your data and didn't get this error... |
Ah, that's the problem! you installed from cran, which is an older version. You can try installing from GitHub by typing |
So I completetly uninstalled the CRAN version of gsynth, reinstalled via devtools like you said and now it works like a charm. Thank you very much for alll your help! |
Hello, I have been facing a similar issue raised above but the error message looks slightly different as shown below. I installed gsynth in RStudio. Based on suggestion above, I tried to install from GitHub but that has not worked. I tried to fix the problem using suggestions from this SO link but to no avail. I have installed gfortran and clang4 R Binaries from the links provided in the gsynth GitHub homepage. But the installation from GitHub just doesn't work. I get the following error message: Any suggestions how to fix this problem? |
Hi, are you installing from BigSur? If yes, please check out this file:
https://yiqingxu.org/public/BigSurError.pdf
…On Thu, Aug 5, 2021 at 5:02 PM svknair ***@***.***> wrote:
Hello,
I have been facing a similar issue raised above but the error message
looks slightly different as shown below.
[image: gsynth error1]
<https://user-images.githubusercontent.com/25752273/128436213-418d188c-efad-42ac-ad60-a051a3dd8c28.png>
I installed synth in RStudio. Based on suggestion above, I tried to
install from GitHub but that has not worked. I tried to fix the problem
using suggestions from this SO link
<https://stackoverflow.com/questions/66359031/install-with-devtoolsinstall-github-fails-to-detect-build-tools>
but to no avail. I have installed gfortran and clang4 R Binaries from the
links provided in the gsynth GitHub homepage. But the installation from
GitHub just doesn't work. I get the following error message:
[image: gsynth error2]
<https://user-images.githubusercontent.com/25752273/128436234-2c04d023-55a4-4d96-aba0-e095cfb05f24.png>
Any suggestions how to fix this problem?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#56 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB2PKGAGIKD4Y6VCHD2GDELT3MRATANCNFSM4YVFJHPA>
.
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&utm_campaign=notification-email>
.
|
Yes, I am installing from BigSur 11.4. Thanks for sharing the solution. I will try that and let you know how it goes. |
Thank you, and it was really painstaking... I hope that R will release a
new version of Rtools to address this...
…On Thu, Aug 5, 2021 at 5:23 PM svknair ***@***.***> wrote:
Hi, are you installing from BigSur? If yes, please check out this file:
https://yiqingxu.org/public/BigSurError.pdf
… <#m_6666690129853809312_>
Yes, I am installing from BigSur 11.4. Thanks for sharing the solution. I
will try that and let you know how it goes.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#56 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB2PKGDIKTMDUCEFI3VI62LT3MTRNANCNFSM4YVFJHPA>
.
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&utm_campaign=notification-email>
.
--
Yiqing Xu
Assistant Professor
Department of Political Science
University of California, San Diego
http://yiqingxu.org/
|
I think I kind of lost my way after step 3. The problem is not solved. Here is what I did after step 3: I did not have a .profile file, so I created a text file with that name and copied the following:
After that, checking for gcc version didn't work. So I typed For step 5, I didn't have a Makevars file, so I created it and pasted the following: `FLIBS=-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin20/20.5.0 -L/usr/local/gfortran/lib CC = gcc After all this I tried installing gsynth from GitHub and got the same error message as before. Not sure if I am doing anything wrong while trying to implement your solution. |
Hi,
I can't debug your system setup. I'll try to update the CRAN version such
that you'll be able to install the package from it using binaries. It may
take a few days (apologies).
Best,
Yiqng
…On Thu, Aug 5, 2021 at 9:47 PM svknair ***@***.***> wrote:
I think I kind of lost my way after step 3. The problem is not solved.
Here is what I did after step 3:
I did not have a .profile file, so I created a text file with that name
and copied the following:
export
PATH="/usr/local/gfortran/bin:/Library/Frameworks/R.framework/Resources:$PATH"
After that, checking for gcc version didn't work. So I typed sudo nano
/etc/paths in terminal and added /usr/local/gfortran/bin at the beginning
of the file. Then I completed step 4.2 by creating the .Renviron file.
For step 5, I didn't have a Makevars file, so I created it and pasted the
following:
`FLIBS=-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin20/20.5.0
-L/usr/local/gfortran/lib
CC = gcc
CXX = g++
CXX98 = g++
CXX11 = g++
CXX14 = g++
CXX17 = g++
CXX20 = g++
CXXCPP = g++
FC = gfortran
F77 = gfortran
OBJC = gcc
OBJCXX = g++`
After all this I tried installing gsynth from GitHub and got the same
error message as before. Not sure if I am doing anything wrong while trying
to implement your solution.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#56 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB2PKGBPKDQOV2BYAEAOLNDT3NSOJANCNFSM4YVFJHPA>
.
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&utm_campaign=notification-email>
.
--
Yiqing Xu
Assistant Professor
Department of Political Science
University of California, San Diego
http://yiqingxu.org/
|
Hi, Appreciate your time and help. Thanks |
A new version (1.2.1) is shipped to CRAN. It will take a few days for CRAN
to release a binary version of the package, which does not
require compilation.
…On Thu, Aug 5, 2021 at 10:23 PM svknair ***@***.***> wrote:
Hi,
Appreciate your time and help.
Thanks
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#56 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB2PKGE7VDWPRCXOYGX642DT3NWWRANCNFSM4YVFJHPA>
.
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&utm_campaign=notification-email>
.
--
Yiqing Xu
Assistant Professor
Department of Political Science
University of California, San Diego
http://yiqingxu.org/
|
You can also try installing from this binary build
<https://github.com/xuyiqing/gsynth/releases/download/1.2.1/gsynth_1.2.1.tgz>
that I just released on Github: RStudio -> Tool -> Install Packages -> From
File
…On Fri, Aug 6, 2021 at 7:58 AM Yiqing Xu ***@***.***> wrote:
A new version (1.2.1) is shipped to CRAN. It will take a few days for CRAN
to release a binary version of the package, which does not
require compilation.
On Thu, Aug 5, 2021 at 10:23 PM svknair ***@***.***> wrote:
> Hi,
>
> Appreciate your time and help.
>
> Thanks
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#56 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AB2PKGE7VDWPRCXOYGX642DT3NWWRANCNFSM4YVFJHPA>
> .
> 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&utm_campaign=notification-email>
> .
>
--
Yiqing Xu
Assistant Professor
Department of Political Science
University of California, San Diego
http://yiqingxu.org/
--
Yiqing Xu
Assistant Professor
Department of Political Science
University of California, San Diego
http://yiqingxu.org/
|
I downloaded the latest version (1.2.1) from CRAN. But R aborts while running gsynth. I tried running gsynth after setting se = FALSE and got the following error:
Do you think this is still related to the macOS problem? |
Have you installed Rcpp?
…On Sun, Aug 8, 2021 at 8:34 PM svknair ***@***.***> wrote:
I downloaded the latest version (1.2.1) from CRAN. But R aborts while
running gsynth. I tried running gsynth after setting se = FALSE and got the
following error:
Error in data_ub_adj(data_I, data_ub) : function 'Rcpp_precious_remove'
not provided by package 'Rcpp'
Do you think this is still related to the macOS problem?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#56 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB2PKGFBFZJMIIILBA6HBT3T35EDZANCNFSM4YVFJHPA>
.
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&utm_campaign=notification-email>
.
--
Yiqing Xu
Assistant Professor
Department of Political Science
University of California, San Diego
http://yiqingxu.org/
|
Yes, I have installed Rcpp. I actually updated Rcpp package to the latest version and now gsynth works fine. Thanks much for your help! |
I have a data frame vdem5 with columns country, year, corruption, bnp and eu (the dichotomous treatment variable). I have tried using gsynth like this:
system.time(out <- gsynth(corruption ~ eu + democracy + bnp, data = vdem5,
index = c("country","year"), force = "two-way",
CV = TRUE, r= c(0,5), se = TRUE,
inference = "parametric", nboots = 1000,
parallel = FALSE))
Console output looks like this:
_Cross-validating ...
r = 0; sigma2 = 0.00244; IC = -5.93214; MSPE = 0.00582
r = 1; sigma2 = 0.00071; IC = -6.05075; MSPE = 0.00289
r = 2; sigma2 = 0.00033; IC = -5.78892; MSPE = 0.00255
r = 3; sigma2 = 0.00011; IC = -5.95324; MSPE = 0.00242
r = 4; sigma2 = 0.00000; IC = -69.55168; MSPE = 0.00225*
r = 5; sigma2 = -0.00000; IC = NaN; MSPE = Inf
r* = 4
Simulating errors ...Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x), :
'data' must be of a vector type, was 'NULL'_
I have checked multiple times that vdem5 is not
NULL
and that all the columns have no missing data.However, if I set
se=FALSE
it works:system.time(out <- gsynth(corruption ~ eu + democracy + bnp, data = vdem5,
index = c("country","year"), force = "two-way",
CV = TRUE, r= c(0,5), se = false,
inference = "parametric", nboots = 1000,
parallel = FALSE))
Now it runs through just fine. Any idea why se=TRUE causes it to fail?
The text was updated successfully, but these errors were encountered: