mice.impute.tricube.pmm: Imputation by Tricube Predictive Mean Matching

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/mice.impute.tricube.pmm.R

Description

This function performs tricube predictive mean matching (see Hmisc::aregImpute) in which donors are weighted according to distances of predicted values.

Usage

1
2
3
mice.impute.tricube.pmm(y, ry, x, tricube.pmm.scale = 0.2, tricube.boot = FALSE, ...)

mice.impute.tricube.pmm2(y, ry, x, tricube.pmm.scale = 0.2, tricube.boot = FALSE, ...)

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.

tricube.pmm.scale

A scaling factor for traicube matching. The default is 0.2.

tricube.boot

A logical indicating whether tricube matching should be performed using a bootstrap sample

...

Further arguments to be passed

Value

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

Note

The imputation method tricube.pmm2 is usually somewhat faster than tricube.pmm.

Author(s)

Alexander Robitzsch

See Also

Hmisc::aregImpute

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Not run: 
#############################################################################
# EXAMPLE 1: Tricube predictive mean matching for nhanes data
#############################################################################

library(mice)
data(nhanes, package="mice")
set.seed(9090)

#*** Model 1: Use default of tricube predictive mean matching
varnames <- colnames(nhanes) 
VV <- length(varnames)
imputationMethod <- rep("tricube.pmm2" , VV )
names(imputationMethod) <- varnames
# imputation with mice
imp.mi1 <- mice::mice( nhanes , m=5 , maxit=4 , imputationMethod= imputationMethod )

#*** Model 2: use item-specific imputation methods
iM2 <- imputationMethod
iM2["bmi"] <- "pmm6"
# use tricube.pmm2 for hyp and chl
# select different scale parameters for these variables
tricube.pmm.scale1 <- list( "hyp" = .15 , "chl" = .30 )
imp.mi2 <- miceadds::mice.1chain( nhanes , burnin=5 , iter=20 , Nimp=4 ,
    imputationMethod= iM2 , tricube.pmm.scale=tricube.pmm.scale1  )

## End(Not run)

miceadds documentation built on May 19, 2017, 7:26 a.m.

Search within the miceadds package
Search all R packages, documentation and source code