Hi Matthijs,
With Zelig, you can specify interaction terms in the "formula"
argument to create these terms on the fly:
depvar ~ indvar1*indvar2
Another possible approach would be to create the interaction term within
each dataset while it is in the Amelia class. Here is an example
creating an interaction between columns 1 and 2:
a.out <- amelia(x, m= 5)
for (i in 1:5) {
inter <- a.out$imputations[[i]][,1] * a.out$imputations[[i]][,2]
a.out$imputations[[i]] <- cbind(a.out$imputations[[i]], inter)
}
This would add the interaction for each imputed dataset.
I hope this helps.
cheers,
matt.
On Wed, Dec 9, 2009 at 4:40 PM, Matthijs De Zwaan <m.dezwaan(a)gmail.com> wrote:
Dear Amelia Listers,
I am new to R, Zelig and Amelia. I think my question is rather straight
forward, but couldn't find an answer on the Amelia list. Please excuse me if
I missed something…
I am using Amelia to create ten new data sets for my missing data. I need to
change the variables in the newly imputed data (I need to create an
interaction variable with my variable with missing values). I do this by
manipulating in turn each of the imputed data sets after having saved those
sets using write.amelia(). Now, how do I again collect those data sets into
an object that Amelia/Zelig can work with?
Thanks for your time,
Matthijs
-
Amelia mailing list served by Harvard-MIT Data Center
[Un]Subscribe/View Archive:
http://lists.gking.harvard.edu/?info=amelia
More info about Amelia:
http://gking.harvard.edu/amelia