View source: R/imputationMice.R
imputationMice | R Documentation |
Imputed missing data using mice::mice()
. This function implements
some additional functionality to mice imputation to be performed by row
rather than by column.
imputationMice( data, by.row = FALSE, row.range = 1:nrow(data), col.range = 1:ncol(data), mice.method = "pmm", m = 5, mice.action = 1L, ... )
data |
a matrix-like R object with two dimensions containing the data to
be passed into |
by.row |
a logical value indicating whether the data should be imputed by row rather than by column (default). |
row.range |
a numeric vector containing the row numbers to be included in the MICE algorithm. |
col.range |
a numeric vector containing the column numbers to be included in the MICE algorithm. |
mice.method |
Can be either a single string, or a vector of strings with
length length(blocks), specifying the imputation method to be used for each
column in data. If specified as a single string, the same method will be
used for all blocks. The default imputation method (when no argument is
specified) depends on the measurement level of the target column, as
regulated by the defaultMethod argument. Columns that need not be imputed
have the empty method "". See details. (from mice documentation. See
|
m |
Numeric value passed to |
mice.action |
A numeric vector or a keyword to be passed into
|
... |
Additional arguments to be passed to |
Returns the passed data with missing values imputed.
# default mice imputed_data <- imputationMice(data) # mice performed by row, excluding the first column. imputed_data_byrow <- imputationMice(data_byrow, by.row = TRUE, col.range = 2:ncol(data_byrow))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.