Hi Vincent,
I'm actually not sure if Zelig can handle that, but I don't work on it so
I'm probably the wrong person to ask. You may want to inquire on the Zelig
mailing list/Google group.
Cheers,
Matt
On Tue, Dec 8, 2015 at 10:42 AM, audigier <audigier(a)agrocampus-ouest.fr>
wrote:
Thank you very much for your help Matt.
Indeed, it works well when the multiply imputed dataset comes from the
amelia function:
library(Rmixmod)
data(titanic);
library(missForest)
set.seed(0)
titanicna<-prodNA(titanic,.2)
summary(titanicna)
Class Age Sex Survived
0 :733 0 : 85 0 : 388 0 :1183
1 :256 1 :1662 1 :1393 1 : 566
2 :225 NA's: 454 NA's: 420 NA's: 452
3 :553
NA's:434
res.amelia<-amelia(titanicna,noms = 1:4)
z5 <- zlogit$new()
z5$zelig(Survived~ Class+Age, data = res.amelia)
z5
Model: Combined Imputations
Estimate Std.Error z value Pr(>|z|)
(Intercept) -0.50632 0.2047 -2.47350 1.338e-02 .
Class1 1.40721 0.1776 7.92321 2.220e-15 ***
Class2 0.66160 0.1602 4.12910 3.642e-05 ***
Class3 -0.00529 0.1374 -0.03852 9.693e-01
Age1 -0.53445 0.1947 -2.74473 6.056e-03 *
---
Signif. codes: '***' 0.001 '**' 0.01 '*' 0.05
'.' 0.1 ' ' 1
For results from individual imputed datasets, use summary(x, subset = i:j)
Next step: Use 'setx' method
However, now I would like to use another function than amelia to perform
MI.
My output is a list of dataframes. Can I use Zelig to achieve this goal?
Thank you very much for your help,
*AUDIGIER Vincent*
Applied Mathematic Department, Agrocampus Ouest
65 rue de Saint-Brieuc, 35042 Rennes Cedex, France
Tel: (+33)2 23 48 54 76
Website:
http://vincentaudigier.weebly.com/
<https://urldefense.proofpoint.com/v2/url?u=http-3A__vincentaudigier.weebly.com_&d=CwMDaQ&c=WO-RGvefibhHBZq3fL85hQ&r=EwICq0J5pL8CwgEJz8qkmauGonk0XmiLpxcYOEgk2a0&m=-vAcQ4-i7N-0s3RoxgXKMkFUertfXtbGk1uP3Q5rrnw&s=C56CMfCFmK_9oX46hLiwSab2-k_MvuFQFwSOIXU_5L0&e=>
Le 08/12/2015 15:12, Matt Blackwell a écrit :
Hi Vincent,
We just released an update to Amelia and now the vignette shows how to use
the latest version of Zelig. See Section 4.10 here:
https://cran.r-project.org/web/packages/Amelia/vignettes/amelia.pdf
<https://urldefense.proofpoint.com/v2/url?u=https-3A__cran.r-2Dproject.org_web_packages_Amelia_vignettes_amelia.pdf&d=CwMDaQ&c=WO-RGvefibhHBZq3fL85hQ&r=EwICq0J5pL8CwgEJz8qkmauGonk0XmiLpxcYOEgk2a0&m=-vAcQ4-i7N-0s3RoxgXKMkFUertfXtbGk1uP3Q5rrnw&s=p6halMunaLh02OIg5g3ilYp9ion6x5VSMSoi6WWW-dk&e=>
Or see the Zelig documentation here:
<https://urldefense.proofpoint.com/v2/url?u=http-3A__docs.zeligproject.org_en_latest_using-2DZelig-2Dwith-2DAmelia.html&d=CwMDaQ&c=WO-RGvefibhHBZq3fL85hQ&r=EwICq0J5pL8CwgEJz8qkmauGonk0XmiLpxcYOEgk2a0&m=-vAcQ4-i7N-0s3RoxgXKMkFUertfXtbGk1uP3Q5rrnw&s=2XxLDHSueEdcsJjYBxkufcO004gAD95fcXaYM_F8kZQ&e=>
http://docs.zeligproject.org/en/latest/using-Zelig-with-Amelia.html
<https://urldefense.proofpoint.com/v2/url?u=http-3A__docs.zeligproject.org_en_latest_using-2DZelig-2Dwith-2DAmelia.html&d=CwMDaQ&c=WO-RGvefibhHBZq3fL85hQ&r=EwICq0J5pL8CwgEJz8qkmauGonk0XmiLpxcYOEgk2a0&m=-vAcQ4-i7N-0s3RoxgXKMkFUertfXtbGk1uP3Q5rrnw&s=2XxLDHSueEdcsJjYBxkufcO004gAD95fcXaYM_F8kZQ&e=>
Cheers,
Matt
~~~~~~~~~~~
Matthew Blackwell
Assistant Professor of Government
Harvard University
url:
http://www.mattblackwell.org
<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.mattblackwell.org&d=CwMDaQ&c=WO-RGvefibhHBZq3fL85hQ&r=EwICq0J5pL8CwgEJz8qkmauGonk0XmiLpxcYOEgk2a0&m=-vAcQ4-i7N-0s3RoxgXKMkFUertfXtbGk1uP3Q5rrnw&s=D7WJsoQYeyzE-23YpgYAHzT10rjw0TrI2MxTNaUjMJo&e=>
On Tue, Dec 8, 2015 at 8:22 AM, Vincent Audigier <
vincent.audigier(a)agrocampus-ouest.fr> wrote:
Dear list members,
I would like to analyse a multiply imputed data set with zelig,
but I don't know how to do with the last version of the Zelig package.
For instance, the following code, which runs well using a previous version
of the package (4.2.1 for instance), produces an error with the version
5.0.9:
library("Amelia")
data(freetrade)
amelia.out <- amelia(freetrade, m = 15, ts = "year", cs =
"country")
is.list(amelia.out$imputations)
#TRUE
is.data.frame(amelia.out$imputations[[1]])
#TRUE
library("Zelig")
zelig.fit <- zelig(tariff ~ pop + gdp.pc + year + polity, data =
amelia.out$imputations, model = "ls", cite = FALSE)
#Error: data is not a data frame
Could you give me an example to show me how to use the last version
of Zelig?
Thank you very much for your help,
Best,
--
*AUDIGIER Vincent*
Applied Mathematic Department, Agrocampus Ouest
65 rue de Saint-Brieuc, 35042 Rennes Cedex, France
Tel: (+33)2 23 48 54 76 <%28%2B33%292%2023%2048%2054%2076>
Website:
http://vincentaudigier.weebly.com/
<https://urldefense.proofpoint.com/v2/url?u=http-3A__vincentaudigier.weebly.com_&d=CwMCaQ&c=WO-RGvefibhHBZq3fL85hQ&r=EwICq0J5pL8CwgEJz8qkmauGonk0XmiLpxcYOEgk2a0&m=FXpCFO6P5ad6FfRsV0Ok0x6YB5-_Gicd4NdG0FzUAtk&s=hp7cTyqA159HN2feIubmqiH_eza7Th9oANR_anImwi0&e=>
--
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
To unsubscribe from this list or get other information:
https://lists.gking.harvard.edu/mailman/listinfo/amelia