Learn R Programming

VIM (version 3.0.2)

hotdeck: Hot-Deck Imputation

Description

Implementation of the popular Sequential, Random (within a domain) hot-deck algorithm for imputation.

Usage

hotdeck(data, variable = NULL, ord_var = NULL,
    domain_var = NULL, makeNA = NULL, NAcond = NULL, impNA = TRUE,
    donorcond = NULL, imp_var = TRUE, imp_suffix = "imp")

Arguments

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

Value

  • the imputed data set.

Examples

Run this code
data(sleep)
sleepI <- hotdeck(sleep)
sleepI2 <- hotdeck(sleep,ord_var="BodyWgt",domain_var="Pred")

Run the code above in your browser using DataLab