mice.impute.hotDeck: Imputation of a Variable Using Probabilistic Hot Deck...

Description Usage Arguments Value References See Also Examples

View source: R/mice.impute.hotDeck.R

Description

Imputes a variable under a random draw from a pool of donors defined by a distance function. Uncertainty with respect to the creation of donor pools is introduced by drawing a Bootstrap sample (approximate Bayesian Bootstrap, ABB) from observations with complete data (see Andridge & Little, 2010).

Usage

1
mice.impute.hotDeck(y, ry, x, donors=5, method = "Mahalanobis" , ...)

Arguments

y

Incomplete data vector of length n

ry

Vector of missing data pattern (FALSE – missing, TRUE – observed)

x

Matrix (n x p) of complete covariates.

donors

Number of donors used for random sampling of nearest neighbors in imputation

method

Method used for computation of weights in distance function. Options are the Mahalanobis metric (method="Mahalanobis"), weighted by correlations of covariates with the outcome (method="cor") and weighting by linear regression coefficients (method="lm").

...

Further arguments to be passed

Value

A vector of length nmis=sum(!ry) with imputed values.

References

Andridge, R. R., & and Little, R. J. A. (2010). A review of hot deck imputation for survey non-response. International Statistical Review, 78, 40-64.

See Also

See also the packages hot.deck and HotDeckImputation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
#############################################################################
# EXAMPLE 1: Hot deck imputation NHANES dataset
#############################################################################	

data(nhanes, package="mice")
dat <- nhanes

#*** prepare imputation method
vars <- colnames(dat)
V <- length(vars)
impMethod <- rep("hotDeck" , V)
method <- "cor"

#*** imputation in mice
imp <- mice::mice( data=as.matrix(dat), m=1, imputationMethod=impMethod,
               method=method )
summary(imp)

## End(Not run)

Example output

Loading required package: mice
* miceadds 2.5-9 (2017-06-17 14:42:44)

 iter imp variable
  1   1  bmi  hyp  chl
  2   1  bmi  hyp  chl
  3   1  bmi  hyp  chl
  4   1  bmi  hyp  chl
  5   1  bmi  hyp  chl
Multiply imputed data set
Call:
mice::mice(data = as.matrix(dat), m = 1, method = method, imputationMethod = impMethod)
Number of multiple imputations:  1
Missing cells per column:
age bmi hyp chl 
  0   9   8  10 
Imputation methods:
      age       bmi       hyp       chl 
"hotDeck" "hotDeck" "hotDeck" "hotDeck" 
VisitSequence:
bmi hyp chl 
  2   3   4 
PredictorMatrix:
    age bmi hyp chl
age   0   0   0   0
bmi   1   0   1   1
hyp   1   1   0   1
chl   1   1   1   0
Random generator seed value:  NA 

miceadds documentation built on Nov. 21, 2017, 1:05 a.m.