View source: R/mice_quickpred_extension.R
quickpred_ext | R Documentation |
quickpred
creates a predictor matrix that suggests which variables should
be used for multiple imputation. However, it does not yield meaningful information
for (unordered) factors. This function returns the same as mice::quickpred for
numeric and logical variables and binary factors, but excludes character
vectors and tests the predictive power of each level of factors with more
than two levels separately (through dummy coding). If the correlation exceeds 'mincor' for at least one
level, the factor variable is used as a predictor.
quickpred_ext( data, mincor = 0.1, minpuc = 0, include = "", exclude = "", method = "pearson" )
data |
Matrix or data frame with incomplete data. |
mincor |
A scalar, numeric vector (of size |
minpuc |
A scalar, vector (of size |
include |
A string or a vector of strings containing one or more
variable names from |
exclude |
A string or a vector of strings containing one or more
variable names from |
method |
A string specifying the type of correlation. Use
|
A square binary matrix of size ncol(data)
.
This function is based on the mice::quickpred function as available in mice v 3.11.4, written by Stef van Buuren. The code for dummy coding factor variables is based on psych::dummy.code, written by William Revelle
quickpred
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.