
Last chance! 50% off unlimited learning
Sale ends in
Calculates the number of cells within a block for which imputation is requested.
nimp(where, blocks = make.blocks(where))
A data frame or matrix with logicals of the same dimensions
as data
indicating where in the data the imputations should be
created. The default, where = is.na(data)
, specifies that the
missing data should be imputed. The where
argument may be used to
overimpute observed data, or to skip imputations for selected missing values.
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 method
argument). By default each variable is placed
into its own block, which is effectively
fully conditional specification (FCS) by univariate models
(variable-by-variable imputation). Only variables whose names appear in
blocks
are imputed. The relevant columns in the where
matrix are set to FALSE
of variables that are not block members.
A variable may appear in multiple blocks. In that case, it is
effectively re-imputed each time that it is visited.
A numeric vector of length length(blocks)
containing
the number of cells that need to be imputed within a block.
# NOT RUN {
where <- is.na(nhanes)
# standard FCS
nimp(where)
# user-defined blocks
nimp(where, blocks = name.blocks(list(c("bmi", "hyp"), "age", "chl")))
# }
Run the code above in your browser using DataLab