This helper function creates a valid where matrix. The where matrix is an argument to the mice function. It has the same size as data and specifies which values are to be imputed (TRUE) or nor (FALSE).

make.where(data, keyword = c("missing", "all", "none", "observed"))

Arguments

data

A data.frame with the source data

keyword

An optional keyword, one of "missing" (missing values are imputed), "observed" (observed values are imputed), "all" and "none". The default is keyword = "missing"

Value

A matrix with logical

See also

Examples

head(make.where(nhanes), 3)
#> age bmi hyp chl #> 1 FALSE TRUE TRUE TRUE #> 2 FALSE FALSE FALSE FALSE #> 3 FALSE TRUE FALSE FALSE