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 Blackwell
PhD Candidate
Institute for Quantitative Social Science
Department of Government
Harvard University
url: http://www.mattblackwell.org
On 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 Blackwell
> PhD Candidate
> Institute for Quantitative Social Science
> Department of Government
> Harvard University
> url: http://www.mattblackwell.org
>
>
> On 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 <- 4
> > foreach(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 warning
> > Error 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=amelia
> > More info about Amelia: http://gking.harvard.edu/amelia
> > Amelia mailing list
> > Amelia(a)lists.gking.harvard.edu (mailto:Amelia@lists.gking.harvard.edu)
> > https://lists.gking.harvard.edu/mailman/listinfo/amelia
> >
> >
> >
>
>
Dear Amelia users
I'm using Amelia 2 in R to do the multiple imputation. I have
successfully run the imputation and saved them into Stata files. Is
there any way I can load the completed data sets back to Stata without
using the Clarify package? I am asking because Clarify does not
support models such as xtmixed, which I'd like to use for my analysis.
I'm also not sure whether I can just calculate the coefficients and
standard errors by hand when it comes to Multi-level models.
Thanks for your help,
Ken
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 <- 4
foreach(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 warning
Error 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!
Hi,
I have a hopefully quick question: Are there any prohibitions/issues
with imputing missing values for a treatment variable in a quasi-exp
or exp design (for example somehow treatment status wasn't reported in
an observational study or failed to be recorded in an experimental
study)? What about the dependent variable?
Thank you very much!
Prashant