Hi Audrey,
Ah, sorry, I read your example too quickly. The imputations from amelia()
now follow the new Zelig requirements for named lists, but this example does
not. Here's a updated example that should work:
z.out <- zelig(as.factor(ipip) ~ wage1992 + prtyid + ideol,
+ model = "ologit",
+ data = mi(imp1=immi1, imp2=immi2, imp3=immi3, imp4=immi4, imp5=immi5))
Thus, you simply need to add names to each item of the mi() list. I'm not
sure if the mi() class should require names, but this code should work
either way.
Cheers,
matt.
2011/8/21 Audrey Sacks <sacks(a)u.washington.edu>
Dear Matt,
Thanks for your response. The same error still shows up after I install
the newer version of Amelia as you suggest below.
Here's my sessioninfo and codes
Thanks,
Audrey
R version 2.13.1 (2011-07-08)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i386-pc-mingw32/i386 (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
install.packages("Amelia", repos = "http://r.iq.harvard.edu", type
=
"source")
Installing package(s) into ‘C:/Users/Audrey/Desktop/**
Documents/R/win-library/2.13’
(as ‘lib’ is unspecified)
trying URL
'http://r.iq.harvard.edu/src/**contrib/Amelia_1.5-4.tar.gz<http://r.iq.harvard.edu/src/contrib/Amelia_1.5-4.tar.gz>
'
Content type 'application/x-gzip' length 1078553 bytes (1.0 Mb)
opened URL
downloaded 1.0 Mb
* installing *source* package 'Amelia' ...
** R
** data
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices ...
** testing if installed package can be loaded
## ## Amelia II: Multiple Imputation
## (Version 1.5-4, built: 2011-08-21)
## Copyright (C) 2005-2011 James Honaker, Gary King and Matthew Blackwell
## Refer to
http://gking.harvard.edu/**amelia/<http://gking.harvard.edu/amelia/>f…
more information
##
* DONE (Amelia)
The downloaded packages are in
‘C:\Users\Audrey\AppData\**Local\Temp\RtmpRzvM0Y\**
downloaded_packages’
library(Zelig)
Loading required package: MASS
Loading required package: boot
Loading required package: MNP
MNP: R Package for Fitting the Multinomial Probit Model
Version: 2.6-2
## ## Zelig (Version 3.5-1, built: 2011-03-25)
## Please refer to
http://gking.harvard.edu/zelig for full
## documentation or help.zelig() for help with commands and
## models supported by Zelig.
##
## Zelig project citations:
## Kosuke Imai, Gary King, and Olivia Lau. (2009).
## ``Zelig: Everyone's Statistical Software,''
##
http://gking.harvard.edu/zelig**.
## and
## Kosuke Imai, Gary King, and Olivia Lau. (2008).
## ``Toward A Common Framework for Statistical Analysis
## and Development,'' Journal of Computational and
## Graphical Statistics, Vol. 17, No. 4 (December)
## pp. 892-913.
## To cite individual Zelig models, please use the citation format printed
with
## each model run and in the documentation.
##
Warning message:
'.readRDS' is deprecated.
Use 'readRDS' instead.
See help("Deprecated")
library(Amelia)
Loading required package: foreign
## ## Amelia II: Multiple Imputation
## (Version 1.5-4, built: 2011-08-21)
## Copyright (C) 2005-2011 James Honaker, Gary King and Matthew Blackwell
## Refer to
http://gking.harvard.edu/**amelia/<http://gking.harvard.edu/amelia/>f…
more information
##
data(turnout)
data(immi1, immi2, immi3, immi4, immi5)
z.out <- zelig(as.factor(ipip) ~ wage1992 + prtyid + ideol,
+ model = "ologit",
+ data = mi(immi1, immi2, immi3, immi4, immi5))
Error in attach(data) : all elements of a list must be named