genetic demo
by Durlacher, Katherine R. DPI
Hi,
I'm just working through the demos found in the package literature, and I'm having trouble getting the "genetic" demo to run. First it appeared that I needed to install the Matching package so I did that. Then, it appeared that some of the variables were misnamed so I fixed those. The current error that I can't fix is "could not find function genoud". Does anyone know how to get this example to run?
Thanks!
-Katherine
> demo("genetic")
demo(genetic)
---- ~~~~~~~
Type <Return> to start :
> ####
> #### demo file for Genetic Matching
> ####
>
> ## loading the lalonde data
> data(lalonde)
> ## using logistic propensity score as one of the covariates
> m.out <- matchit(treat ~ age + educ + black + hispan + married + nodegree + re74 + re75, data = lalonde, method = "genetic", distance = "logit")
Error in eval(expr, envir, enclos) : object 'hispan' not found
> names(lalonde)
[1] "age" "educ" "black" "hisp" "married" "nodegr" "re74" "re75" "re78" "u74"
[11] "u75" "treat"
> m.out <- matchit(treat ~ age + educ + black + hisp + married + nodegree + re74 + re75, data = lalonde, method = "genetic", distance = "logit")
Error in eval(expr, envir, enclos) : object 'nodegree' not found
> m.out <- matchit(treat ~ age + educ + black + hisp + married + nodegr + re74 + re75, data = lalonde, method = "genetic", distance = "logit")
Loading required package: rgenoud
Error in GenMatch(tt, cbind(dd, xx), M = ratio, ...) :
could not find function "genoud"
In addition: Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'rgenoud'
2: In GenMatch(tt, cbind(dd, xx), M = ratio, ...) :
The key tuning parameters for optimization were are all left at their default values. The 'pop.size' option in particular should probably be increased for optimal results. For details please see the help page and http://sekhon.berkeley.edu/papers/MatchingJSS.pdf