Amelia: A Program for Missing Data

欠損値処理

> library(Amelia)
Loading required package: Rcpp
## 
## Amelia II: Multiple Imputation
## (Version 1.7.4, built: 2015-12-05)
## Copyright (C) 2005-2017 James Honaker, Gary King and Matthew Blackwell
## Refer to http://gking.harvard.edu/amelia/ for more information
##
> data("africa")

バージョン: 1.7.4


関数名 概略
AmeliaView Interactive GUI for Amelia
africa Economic and Political Indictors in 6 African States
amelia AMELIA: Multiple Imputation of Incomplete Multivariate Data
amelia-package Amelia II: A Program for Missing Data
ameliabind Combine multiple runs of Amelia
combine.output Combine Multiple Amelia Output Lists
compare.density Compare observed versus imputed densities
disperse Overdispersed starting values diagnostic for multiple imputation
freetrade Trade Policy and Democracy in 9 Asian States
mi.meld Combine Multiple Results From Multiply Imputed Datasets
missmap Missingness Map
moPrep Prepare Multiple Overimputation Settings
overimpute Overimputation diagnostic plot
plot.amelia Summary plots for Amelia objects
summary.amelia Summary of an Amelia object
transform.amelia Transform imputed datasets from Amelia objects
tscsPlot Plot observed and imputed time-series for a single cross-section
write.amelia Write Amelia imputations to file

ameria

多重代入法

Arguments

  • x
  • m
  • p2s
  • frontend
  • idvars
  • ts
  • cs
  • polytime
  • splinetime
  • intercs
  • lags
  • leads
  • startvals
  • tolerance
  • logs
  • sqrts
  • lgstc
  • noms
  • ords
  • incheck
  • collect
  • arglist
  • empri
  • priors
  • autopri
  • emburn
  • bounds
  • max.resample
  • overimp
  • boot.type
  • parallel
  • ncpus
  • cl
  • ...
> a.out <- amelia(x = africa, cs = "country", ts = "year", logs = "gdp_pc")
-- Imputation 1 --

  1  2  3

-- Imputation 2 --

  1  2  3

-- Imputation 3 --

  1  2  3

-- Imputation 4 --

  1  2

-- Imputation 5 --

  1  2
> summary(a.out)

Amelia output with 5 imputed datasets.
Return code:  1 
Message:  Normal EM convergence. 

Chain Lengths:
--------------
Imputation 1:  3
Imputation 2:  3
Imputation 3:  3
Imputation 4:  2
Imputation 5:  2

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.0000000000000
country     0.0000000000000
gdp_pc      0.0166666666667
infl        0.0000000000000
trade       0.0416666666667
civlib      0.0000000000000
population  0.0000000000000
> # plot(a.out)

africa

アフリカの6つの州における経済と政治の指標

> africa
    year      country gdp_pc   infl  trade    civlib population
1   1972 Burkina Faso    377  -2.92  29.69 0.5000000    5848380
2   1973 Burkina Faso    376   7.60  31.31 0.5000000    5958700
3   1974 Burkina Faso    393   8.72  35.22 0.3333333    6075700
4   1975 Burkina Faso    416  18.76  40.11 0.3333333    6202000
5   1976 Burkina Faso    435  -8.40  37.76 0.5000000    6341030
6   1977 Burkina Faso    448  29.99  41.11 0.6666667    6486870
7   1978 Burkina Faso    445   8.27  37.71 0.6666667    6639120
8   1979 Burkina Faso    461  14.99  40.21 0.3333333    6797540
9   1980 Burkina Faso    457  12.20  43.09 0.3333333    6962000
10  1981 Burkina Faso    466   7.56  43.64 0.3333333    7132320
11  1982 Burkina Faso    512  12.06  42.62 0.3333333    7308230
12  1983 Burkina Faso    502   8.34  40.11 0.3333333    7490710
13  1984 Burkina Faso    474   4.85  42.72 0.1666667    7681280
14  1985 Burkina Faso    495   6.91  44.63 0.1666667    7881000
15  1986 Burkina Faso    511  -2.61  41.83 0.1666667    8089720
16  1987 Burkina Faso    511  -2.68  41.56 0.1666667    8307470
17  1988 Burkina Faso    522   4.06  37.92 0.1666667    8534390
18  1989 Burkina Faso    519  -0.29  35.19 0.3333333    8770560
19  1990 Burkina Faso    511  -0.83  38.37 0.3333333    9016000
20  1991 Burkina Faso    522   2.50  38.75 0.3333333    9269910
21  1972      Burundi    431   3.83  26.81 0.0000000    3561200
22  1973      Burundi    447   6.01  24.35 0.0000000    3591040
23  1974      Burundi    434  15.72  25.29 0.0000000    3629810
24  1975      Burundi    447  15.71  27.28 0.1666667    3680000
25  1976      Burundi    451   6.86  30.38 0.1666667    3744200
26  1977      Burundi    508   6.83  34.89 0.1666667    3825120
27  1978      Burundi    489  23.90  31.93 0.1666667    3919830
28  1979      Burundi    487  36.54  36.88 0.1666667    4022680
29  1980      Burundi    480   2.50  32.10 0.1666667    4130000
30  1981      Burundi    506  12.17  31.18 0.1666667    4242970
31  1982      Burundi    503   5.87  37.12 0.1666667    4361930
32  1983      Burundi    487   8.15  33.79 0.1666667    4486360
33  1984      Burundi    483  14.32  35.06 0.1666667    4615820
34  1985      Burundi    527   3.80  31.67 0.1666667    4750000
35  1986      Burundi    551   1.68     NA 0.1666667    4888660
36  1987      Burundi    538   7.11  35.48 0.1666667    5031680
37  1988      Burundi    559   4.49  38.55 0.1666667    5179010
38  1989      Burundi    532  11.66     NA 0.1666667    5330730
39  1990      Burundi    550   7.00     NA 0.1666667    5487000
40  1991      Burundi    560   9.00  38.42 0.1666667    5643320
41  1972     Cameroon    815   8.09  46.48 0.5000000    6835870
42  1973     Cameroon     NA  10.38     NA 0.5000000    7021850
43  1974     Cameroon    902  17.23  48.24 0.5000000    7222900
44  1975     Cameroon    859  13.55  48.23 0.3333333    7439000
45  1976     Cameroon    888   9.93  50.01 0.3333333    7670990
46  1977     Cameroon     NA  14.70     NA 0.3333333    7920570
47  1978     Cameroon    972  12.46  51.78 0.3333333    8181400
48  1979     Cameroon   1072   6.58  49.32 0.1666667    8443580
49  1980     Cameroon   1194   9.55  54.25 0.1666667    8701000
50  1981     Cameroon   1294  10.73  61.55 0.1666667    8955800
51  1982     Cameroon   1281  13.26  59.59 0.1666667    9209480
52  1983     Cameroon   1342  16.63  61.93 0.1666667    9462950
53  1984     Cameroon   1403  11.37  63.53 0.0000000    9717920
54  1985     Cameroon   1487   8.51  65.02 0.0000000    9977000
55  1986     Cameroon   1499   7.77  46.01 0.1666667   10249210
56  1987     Cameroon   1439  13.14  37.32 0.1666667   10535260
57  1988     Cameroon   1330   1.68  31.99 0.1666667   10835870
58  1989     Cameroon   1361  -1.67  38.48 0.1666667   11151840
59  1990     Cameroon   1226   1.10  37.71 0.1666667   11484000
60  1991     Cameroon   1110   0.06  34.63 0.1666667   11825390
61  1972        Congo   1700   9.77  80.10 0.0000000    1332490
62  1973        Congo   1710   3.51  75.00 0.1666667    1369240
63  1974        Congo   1712   5.38 112.70 0.1666667    1407400
64  1975        Congo   1726  17.38  99.64 0.1666667    1447000
65  1976        Congo   1795   7.22 106.93 0.1666667    1488260
66  1977        Congo   1639  14.01 110.85 0.1666667    1531030
67  1978        Congo   1742  10.53 104.79 0.1666667    1575360
68  1979        Congo   1725   8.11  96.04 0.0000000    1621320
69  1980        Congo   1931   7.27 120.14 0.0000000    1669000
70  1981        Congo   2044  16.96 134.11 0.1666667    1718390
71  1982        Congo   2529  12.81 123.77 0.1666667    1769340
72  1983        Congo   2550   7.72 109.71 0.1666667    1822420
73  1984        Congo   2723  13.21 107.25 0.1666667    1878480
74  1985        Congo   2697   5.59 112.79 0.1666667    1938000
75  1986        Congo   2526   2.35  93.50 0.1666667    2000640
76  1987        Congo   2384   2.18  80.36 0.1666667    2066110
77  1988        Congo   2340   3.81  81.05 0.1666667    2134110
78  1989        Congo   2317   4.14  83.81 0.1666667    2204240
79  1990        Congo   2211  -4.79  97.91 0.1666667    2276000
80  1991        Congo   2405   9.16  90.79 0.5000000    2347830
81  1972      Senegal   1133   6.15  65.20 0.1666667    4404700
82  1973      Senegal   1062  11.29  67.23 0.3333333    4535250
83  1974      Senegal   1062  16.60  91.44 0.3333333    4669250
84  1975      Senegal   1123  31.65  78.37 0.5000000    4806000
85  1976      Senegal   1165   1.08  80.62 0.5000000    4944850
86  1977      Senegal   1156  11.34  94.29 0.6666667    5087300
87  1978      Senegal   1110   3.42  75.34 0.6666667    5233530
88  1979      Senegal   1174   9.65  73.88 0.6666667    5383710
89  1980      Senegal   1134   8.73  72.26 0.5000000    5538000
90  1981      Senegal   1139   5.91  83.56 0.5000000    5696390
91  1982      Senegal   1203  17.38  80.70 0.5000000    5858750
92  1983      Senegal   1188  11.62  78.12 0.5000000    6025550
93  1984      Senegal   1127  11.78  85.34 0.5000000    6197520
94  1985      Senegal   1163  13.00  70.63 0.5000000    6375000
95  1986      Senegal   1155   6.18  58.45 0.5000000    6556690
96  1987      Senegal   1171  -4.14  55.49 0.5000000    6742660
97  1988      Senegal   1172  -1.83  51.87 0.5000000    6932990
98  1989      Senegal   1139   0.45  58.76 0.6666667    7127740
99  1990      Senegal   1145   0.33  58.91 0.6666667    7327000
100 1991      Senegal   1120  -1.75  56.38 0.6666667    7497300
101 1972       Zambia   1185   5.06  86.04 0.3333333    4423360
102 1973       Zambia   1163   6.46  82.45 0.5000000    4552410
103 1974       Zambia   1208   8.10  91.26 0.5000000    4691360
104 1975       Zambia   1251  10.13  92.85 0.3333333    4841000
105 1976       Zambia   1174  18.80  81.72 0.3333333    5002480
106 1977       Zambia   1047  19.77  81.27 0.3333333    5177360
107 1978       Zambia   1007  16.35  70.48 0.3333333    5361950
108 1979       Zambia    950   9.72  81.86 0.3333333    5550120
109 1980       Zambia    971  11.63  86.80 0.1666667    5738000
110 1981       Zambia   1024  12.98  69.78 0.1666667    5926790
111 1982       Zambia    940  13.59  64.16 0.1666667    6117120
112 1983       Zambia    840  19.60  64.41 0.1666667    6309060
113 1984       Zambia    827  20.01  68.30 0.3333333    6503080
114 1985       Zambia    808  37.25  73.64 0.3333333    6700000
115 1986       Zambia    786  51.85  86.02 0.3333333    6901040
116 1987       Zambia    760  43.01  75.16 0.3333333    7107800
117 1988       Zambia    757  55.56  59.47 0.3333333    7322250
118 1989       Zambia    756 127.89  60.63 0.3333333    7546740
119 1990       Zambia    689 117.51  72.47 0.3333333    7784000
120 1991       Zambia    699  92.60  71.86 0.6666667    8022380