Description Usage Arguments Details Value Note Author(s) References See Also Examples
Selects predictors according to simple statistics
1 2 3 4 5 6 7 8 
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

This function creates a predictor matrix using the variable selection procedure described in Van Buuren et al.~(1999, p.~687–688). The function is designed to aid in setting up a good imputation model for data with many variables.
Basic workings: The procedure calculates for each variable pair (i.e.
targetpredictor pair) two correlations using all available cases per pair.
The first correlation uses the values of the target and the predictor
directly. The second correlation uses the (binary) response indicator of the
target and the values of the predictor. If the largest (in absolute value) of
these correlations exceeds mincor
, the predictor will be added to the
imputation set. The default value for mincor
is 0.1.
In addition, the procedure eliminates predictors whose proportion of usable
cases fails to meet the minimum specified by minpuc
. The default value
is 0, so predictors are retained even if they have no usable case.
Finally, the procedure includes any predictors named in the include
argument (which is useful for background variables like age and sex) and
eliminates any predictor named in the exclude
argument. If a variable
is listed in both include
and exclude
arguments, the
include
argument takes precedence.
Advanced topic: mincor
and minpuc
are typically specified as
scalars, but vectors and squares matrices of appropriate size will also work.
Each element of the vector corresponds to a row of the predictor matrix, so
the procedure can effectively differentiate between different target
variables. Setting a high values for can be useful for auxiliary, less
important, variables. The set of predictor for those variables can remain
relatively small. Using a square matrix extends the idea to the columns, so
that one can also apply cellwise thresholds.
A square binary matrix of size ncol(data)
.
quickpred()
uses data.matrix
to convert
factors to numbers through their internal codes. Especially for unordered
factors the resulting quantification may not make sense.
Stef van Buuren, Aug 2009
van Buuren, S., Boshuizen, H.C., Knook, D.L. (1999) Multiple imputation of missing blood pressure covariates in survival analysis. Statistics in Medicine, 18, 681–694.
van Buuren, S. and GroothuisOudshoorn, K. (2011). mice
: Multivariate
Imputation by Chained Equations in R
. Journal of Statistical
Software, 45(3), 167. https://www.jstatsoft.org/v45/i03/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  # default: include all predictors with absolute correlation over 0.1
quickpred(nhanes)
# all predictors with absolute correlation over 0.4
quickpred(nhanes, mincor = 0.4)
# include age and bmi, exclude chl
quickpred(nhanes, mincor = 0.4, inc = c("age", "bmi"), exc = "chl")
# only include predictors with at least 30% usable cases
quickpred(nhanes, minpuc = 0.3)
# use low threshold for bmi, and high thresholds for hyp and chl
pred < quickpred(nhanes, mincor = c(0, 0.1, 0.5, 0.5))
pred
# use it directly from mice
imp < mice(nhanes, pred = quickpred(nhanes, minpuc = 0.25, include = "age"))

Attaching package: ‘mice’
The following object is masked from ‘package:stats’:
filter
The following objects are masked from ‘package:base’:
cbind, rbind
age bmi hyp chl
age 0 0 0 0
bmi 1 0 1 1
hyp 1 0 0 1
chl 1 1 1 0
age bmi hyp chl
age 0 0 0 0
bmi 0 0 0 0
hyp 1 0 0 1
chl 1 0 1 0
age bmi hyp chl
age 0 0 0 0
bmi 1 0 0 0
hyp 1 1 0 0
chl 1 1 1 0
age bmi hyp chl
age 0 0 0 0
bmi 1 0 0 0
hyp 1 0 0 0
chl 1 1 1 0
age bmi hyp chl
age 0 0 0 0
bmi 1 0 1 1
hyp 1 0 0 0
chl 1 0 0 0
iter imp variable
1 1 bmi hyp chl
1 2 bmi hyp chl
1 3 bmi hyp chl
1 4 bmi hyp chl
1 5 bmi hyp chl
2 1 bmi hyp chl
2 2 bmi hyp chl
2 3 bmi hyp chl
2 4 bmi hyp chl
2 5 bmi hyp chl
3 1 bmi hyp chl
3 2 bmi hyp chl
3 3 bmi hyp chl
3 4 bmi hyp chl
3 5 bmi hyp chl
4 1 bmi hyp chl
4 2 bmi hyp chl
4 3 bmi hyp chl
4 4 bmi hyp chl
4 5 bmi hyp chl
5 1 bmi hyp chl
5 2 bmi hyp chl
5 3 bmi hyp chl
5 4 bmi hyp chl
5 5 bmi hyp chl
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.