Skip to contents

manage_missing deals with the imputation of missing values in the elementary indicators. It is an internal function.

Usage

manage_missing(data, missing = 0, verbose = TRUE, seed = 1234)

Arguments

data

data matrix of elementary indicators (as returned by create_indicator_matrix()).

missing

method for imputing missing values:

  • missing = 0: missing values are replaced with '0' (not at risk);

  • missing = 1: missing values are imputed using logistic regression. See Details.

verbose

whether a summary of imputed values has to be printed (when missing = 1).

seed

seed for the random draw from a Bernoulli r.v. (when missing = 1). See Details.

Value

data matrix with no missing value.

Details

When missing = 1, elementary indicators are split up into two groups, according to the presence/absence of (at least one) missing values. Hence, the set of indicators without missing values (taken as covariates) is used to 'predict' the missing values in each of the other indicators (seen as dependent variable), using several logistic regression models, one for each indicator with missing values. As such, these models can predict a probability for each combination of observed indicators; then, a random draw from a Bernoulli distribution with the predicted probability as parameter is performed for imputing '0' or '1' in the indicator with missing values.