Thanks for the response, Matt. I had loaded the amelia package, but I just forgot to copy and paste that into the code I submitted to the mailing list. Anyways, I was able to get the script working after some adjustments. Below is the working script:
Hi Isaac,Perhaps this is too simple an answer, but I think you might be missing the "library(Amelia)" call at the beginning of the script. When I add that to the top of the snippet, the code runs clean on my machine. Please let us know if that does not fix the problem.Hope that helps!Cheers,matt.~~~~~~~~~~~Matthew BlackwellPhD CandidateInstitute for Quantitative Social ScienceDepartment of GovernmentHarvard UniversityOn Monday, February 27, 2012 at 9:44 AM, Matt Blackwell wrote:
Hi Isaac,Perhaps this is too simple an answer, but I think you might be missing the "library(Amelia)" call at the beginning of the script. When I add that to the top of the snippet, the code runs clean on my machine. Please let us know if that does not fix the problem.Hope that helps!Cheers,matt.~~~~~~~~~~~Matthew BlackwellPhD CandidateInstitute for Quantitative Social ScienceDepartment of GovernmentHarvard UniversityOn Tuesday, February 21, 2012 at 1:48 PM, Isaac Petersen wrote:
Hi,I want to impute a data set multiple times, but the data set is large so it takes a long time. As a result, I'm trying to run the multiple imputation with parallel processors in Windows, but am having trouble. Here is a quick example:######library(foreach)library(doSNOW)registerDoSNOW(makeCluster(4, type = "SOCK"))getDoParWorkers()getDoParName()getDoParVersion()data(africa)iterations <- 4foreach(i = 1:iterations) %dopar% {amelia(x = africa, m=1, cs = "country", ts = "year", logs = "gdp_pc")}######When I run the foreach loop, I receive the following warningError in { : task 1 failed - "could not find function "amelia""
This is a bizarre error because I have loaded the amelia package and can impute data sets fine outside of the foreach loop. Moreover, if I change %dopar% to %do% to run the imputations in sequence rather than in parallel, the imputations run fine with no errors. How do I get Amelia to impute one data set (m=1) on each of 4 different processors. Finally, how do I combine the data sets after imputing them in parallel -- I assume using the ameliabind() function? How can I do this?
Thanks for all your help. By the way, I'm new to Amelia, so any help would be greatly appreciated!
--Amelia mailing list served by HUIT[Un]Subscribe/View Archive: http://lists.gking.harvard.edu/?info=ameliaMore info about Amelia: http://gking.harvard.edu/ameliaAmelia mailing list