amelia(data,m=5,p2s=1,frontend=FALSE,idvars=NULL,
ts=NULL,cs=NULL,polytime=NULL,intercs=FALSE,
lags=NULL,leads=NULL,startvals=0,tolerance=0.0001,
logs=NULL,sqrts=NULL,lgstc=NULL,noms=NULL,ords=NULL,
incheck=TRUE,collect=FALSE,outname="outdata",
write.out=TRUE,archive=TRUE,arglist=NULL,keep.data=TRUE,
empri=NULL,casepri=NULL,priors=NULL,autopri=0.05, emburn=c(0,0),
bounds=NULL,max.resample=100)
polytime
should vary across the
cross-section.amelia
. This should
only be set to FALSE
if you are extremely confident that your
settings are non-problematic and you aTRUE
, Amelia will use the outname
arugment as the
file prefix.'amarchive.R
amelia
function or from
a saved session from AmeliaView. Values from this list take precendent
over any individually set arugments. See the Amelia manual for more
information.emburn[1]
is
a the minimum EM chain length and emburn[2]
is the
maximum EM chain length. These are ignored if they are less than 1.c(column.number, lower.bound,upper.bound)
See Details below.bounds
. After this value, imputed values are
set to the bounds.m
.
Thus, you can refer to any of the datasets by referencing
output[[i]]
, where i
is the number of the dataset you wish
to reference.
These datasets will be returned in the same format which you passed them.
For example, if you passed a data frame to amelia
you will have
m
data frames in the output list. If you passed a matrix, you
will have m
matrices in the output.
Other objects in the list:m
imputed datatsets
with no missing values. The algorithm first bootstraps a sample dataset
with the same dimensions as the original data, estimates the sufficient statistics (with priors if specified) by EM, and then imputes the missing
values of sample. It repeats this process m
times to produce
the m
complete datasets where the observed values are the same and the unobserved values are drawn from their posterior distributions.
You can provide Amelia with informational priors about the missing
observations in your data. To specify priors, pass a four or five
column matrix to the priors
argument with each row specifying a
different priors as such:
one.prior <- c(row, column, mean,standard deviation)
or,
one.prior <- c(row, column, minimum, maximum, confidence)
.
So, in the first and second column of the priors matrix should be the row and column number of the prior being set. In the other columns should either be the mean and standard deviation of the prior, or a minimum, maximum and confidence level for the prior. You must specify your priors all as distributions or all as confidence ranges. Note that ranges are converted to distributions, so setting a confidence of 1 will generate an error.
Setting a priors for the missing values of an entire variable is done
in the same manner as above, but inputing a 0
for the row
instead of the row number. If priors are set for both the entire
variable and an individual observation, the individual prior takes
precedence.
If each imputation is taking a long time to converge, you can increase
the empirical prior, empri
. This value has the effect of smoothing
out the likelihood surface so that the EM algorithm can more easily find
the maximum. It should be kept as low as possible and only used if needed.
Amelia assumes the data is distributed multivariate normal. There are a
number of variables that can break this assumption. Usually, though, a
transformation can make any variable roughly continuous and unbounded.
We have included a number of commonly needed transformations for data.
Note that the data will not be transformed in the output datasets and the
transformation is simply useful for climbing the likelihood.
Please refer to the Amelia manual for more information on the function
or the options.