Hi,
Running the latest CRAN releases of Zelig and Amelia I find that the
amelia() function does not work properly when Zelig is loaded.
Reproducible example and session info are below.
Best,
Ista
## Amelia works as long as Zelig is not loaded:
library(Amelia)
Loading required package:
foreign
##
## Amelia II: Multiple Imputation
## (Version 1.6.3, built: 2012-06-21)
## Copyright (C) 2005-2012 James Honaker, Gary King and Matthew Blackwell
## Refer to
http://gking.harvard.edu/amelia/ for more information
##
example(amelia)
amelia> data(africa)
amelia> a.out <- amelia(x = africa, cs = "country", ts = "year",
logs
= "gdp_pc")
-- Imputation 1 --
1 2
-- Imputation 2 --
1 2 3
-- Imputation 3 --
1 2 3
-- Imputation 4 --
1 2 3
-- Imputation 5 --
1 2 3
amelia> summary(a.out)
Amelia output with 5 imputed datasets.
Return code: 1
Message: Normal EM convergence.
Chain Lengths:
--------------
Imputation 1: 2
Imputation 2: 3
Imputation 3: 3
Imputation 4: 3
Imputation 5: 3
Rows after Listwise Deletion: 115
Rows after Imputation: 120
Patterns of missingness in the data: 3
Fraction Missing for original variables:
-----------------------------------------
Fraction Missing
year 0.00000000
country 0.00000000
gdp_pc 0.01666667
infl 0.00000000
trade 0.04166667
civlib 0.00000000
population 0.00000000
amelia> plot(a.out)
Hit <Return> to see next plot:
## amelia() does not work if the Zelig package is loaded
library(Zelig)
Loading required package: boot
Loading required package: MASS
Loading required package: sandwich
Loading required package: zoo
Attaching package: ‘zoo’
The following object(s) are masked from ‘package:base’:
as.Date, as.Date.numeric
Loading required package: survival
Loading required package: splines
Attaching package: ‘survival’
The following object(s) are masked from ‘package:boot’:
aml
ZELIG (Versions 4.0-11, built: 2012-08-31)
+----------------------------------------------------------------+
| Please refer to
http://gking.harvard.edu/zelig for full |
| documentation or help.zelig() for help with commands and |
| models support 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. |
+----------------------------------------------------------------+
example(amelia)
amelia> data(africa)
amelia> a.out <- amelia(x = africa, cs = "country", ts = "year",
logs
= "gdp_pc")
-- Imputation 1 --
1 2
-- Imputation 2 --
1 2 3
-- Imputation 3 --
1 2
-- Imputation 4 --
1 2 3 4
-- Imputation 5 --
1 2
amelia> summary(a.out)
Amelia output with imputed datasets.
Return code: 1
Message: Normal EM convergence.
Chain Lengths:
--------------
Error in 1:m : argument of length 0
sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] splines stats graphics grDevices utils datasets
methods base
other attached packages:
[1] Zelig_4.0-11 survival_2.36-14 sandwich_2.2-9 zoo_1.7-8
MASS_7.3-22
[6] boot_1.3-7 Amelia_1.6.3 foreign_0.8-51
loaded via a namespace (and not attached):
[1] grid_2.15.1 lattice_0.20-10 tools_2.15.1