Issue
Disclaimer: I have minimal experience with R, though am familiar with programming in general. All examples were run in RStudio using version 4.0.2 of R.
I am using a package called gsynth to conduct an analysis on some political data. I have a data frame named vdem5
with five variables: country
, corruption
, democracy
, bnp
and eu
(eu is dichotomous/binary, indicates eu-membership). I have tried using gsynth in accordance with their example page as such:
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:
I have checked multiple times that vdem5 is not NULL
and that all the columns have no missing data (although gsynth supposedly can handle this).
What really puzzles me is this: If I set se=FALSE
, so that no standard errors are computed, it works:
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:
This seems to indicate that that data
is in fact not NULL
at the time of running, unless the error message refers to some ther variable with the same name under the hood, maybe?
I would really love to get ahold of those standard errors. Anyone have any tips or similar experience with this?
Solution
I managed to resolve the problem myself by adding more units (aka countries), though the exact reason it failed before is still not clear to me. I've posted an issue on the gsynth github page, recommend anyone struggling with this later on to check it out.
UPDATE:
It turned out that the cause of the problem was the CRAN version of gsynth, removing this and installing vis devtools:
devtools::install_github('xuyiqing/gsynth')
solved the issue!
Answered By - Sifu Answer Checked By - Willingham (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.