Description Usage Arguments Value
Generates Multivariate Imputations by Chained Equations (MICE)
Generates multiple imputations for incomplete multivariate data by Gibbs sampling. Missing data can occur anywhere in the data. The algorithm imputes an incomplete column (the target column) by generating 'plausible' synthetic values given other columns in the data. Each incomplete column must act as a target column, and has its own specific set of predictors. The default set of predictors for a given target consists of all other columns in the data. For predictors that are incomplete themselves, the most recently generated imputations are used to complete the predictors prior to imputation of the target column.
A separate univariate imputation model can be specified for each column. The default imputation method depends on the measurement level of the target column. In addition to these, several other methods are provided. You can also write their own imputation functions, and call these from within the algorithm.
The data may contain categorical variables that are used in a regressions on other variables. The algorithm creates dummy variables for the categories of these variables, and imputes these from the corresponding categorical variable.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
m |
Number of multiple imputations. The default is |
method |
Can be either a single string, or a vector of strings with
length |
predictorMatrix |
A numeric matrix of length(blocks) rows
and ncol(data) columns, containing 0/1 data specifying
the set of predictors to be used for each target column.
Each row corresponds to a variable block, i.e., a set of variables
to be imputed. A value of |
where |
A data frame or matrix with logicals of the same dimensions
as |
blocks |
List of vectors with variable names per block. List elements
may be named to identify blocks. Variables within a block are
imputed by a multivariate imputation method
(see |
visitSequence |
A vector of block names of arbitrary length, specifying the
sequence of blocks that are imputed during one iteration of the Gibbs
sampler. A block is a collection of variables. All variables that are
members of the same block are imputed
when the block is visited. A variable that is a member of multiple blocks
is re-imputed within the same iteration.
The default |
formulas |
A named list of formula's, or expressions that
can be converted into formula's by |
blots |
A named |
post |
A vector of strings with length |
defaultMethod |
A vector of length 4 containing the default
imputation methods for 1) numeric data, 2) factor data with 2 levels, 3)
factor data with > 2 unordered levels, and 4) factor data with > 2
ordered levels. By default, the method uses
|
maxit |
A scalar giving the number of iterations. The default is 5. |
printFlag |
If |
seed |
An integer that is used as argument by the set.seed() for offsetting the random number generator. Default is to leave the random number generator alone. |
data.init |
A data frame of the same size and type as |
data |
A data frame or a matrix containing the incomplete data. Missing
values are coded as |
... |
Named arguments that are passed down to the univariate imputation functions. |
Returns an S3 object of class mids
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.