Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

make.where

Creates a where argument


Description

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).

Usage

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)

mice

Multivariate Imputation by Chained Equations

v3.13.0
GPL-2 | GPL-3
Authors
Stef van Buuren [aut, cre], Karin Groothuis-Oudshoorn [aut], Gerko Vink [ctb], Rianne Schouten [ctb], Alexander Robitzsch [ctb], Patrick Rockenschaub [ctb], Lisa Doove [ctb], Shahab Jolani [ctb], Margarita Moreno-Betancur [ctb], Ian White [ctb], Philipp Gaffert [ctb], Florian Meinfelder [ctb], Bernie Gray [ctb], Vincent Arel-Bundock [ctb]
Initial release
2021-01-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.