R: Impute Missing Data Under General Location Model
imp.mix
R Documentation
Impute Missing Data Under General Location Model
Description
This function, when used with da.mix or
dabipf.mix, can be
used to create proper multiple imputations of missing data under
the general location model with or without restrictions.
Usage
imp.mix(s, theta, x)
Arguments
s
summary list of an incomplete data matrix x created by the
function prelim.mix.
theta
value of the parameter under which the missing data are to be
randomly imputed. This is a parameter list such as one created
by da.mix or dabipf.mix.
x
the original data matrix used to create the summary list s. If this
argument is not supplied, then the data matrix returned by this
function may disagree slightly with the observed values in x due to
rounding errors.
Details
This function is essentially the I-step of data augmentation.
Value
a matrix of the same form as x, but with all missing values filled in
with simulated values drawn from their predictive distribution given
the observed data and the specified parameter.
Note
The random number generator seed must be set at least once by the
function rngseed before this function can be used.
References
Schafer, J. L. (1996) Analysis of Incomplete Multivariate Data.
Chapman & Hall, Chapter 9.
See Also
prelim.mix, da.mix,
dabipf.mix, rngseed
Examples
data(stlouis)
s <- prelim.mix(stlouis,3) # do preliminary manipulations
thetahat <- em.mix(s) # ML estimate for unrestricted model
rngseed(1234567) # set random number generator seed
newtheta <- da.mix(s,thetahat,steps=100) # data augmentation
ximp <- imp.mix(s, newtheta, stlouis) # impute under newtheta