hotdeck {VIM} | R Documentation |
Implementation of the popular Sequential, Random (within a domain) hot-deck algorithm for imputation.
hotdeck(data, variable = colnames(data), ord_var = NULL, domain_var = NULL, makeNA = NULL, NAcond = NULL, impNA = TRUE, donorcond = NULL, imp_var = TRUE, imp_suffix = "imp")
data |
data.frame or matrix |
variable |
variables where missing values should be imputed |
ord_var |
variables for sorting the data set before imputation |
domain_var |
variables for building domains and impute within these domains |
makeNA |
vector of values, that should be converted to NA |
NAcond |
a condition for imputing a NA |
impNA |
TRUE/FALSE whether NA should be imputed |
donorcond |
condition for the donors e.g. ">5" |
imp_var |
TRUE/FALSE if a TRUE/FALSE variables for each imputed variable should be created show the imputation status |
imp_suffix |
suffix for the TRUE/FALSE variables showing the imputation status |
the imputed data set.
Alexander Kowarik
data(sleep) sleepI <- hotdeck(sleep) sleepI2 <- hotdeck(sleep,ord_var="BodyWgt",domain_var="Pred")