Learn R Programming

mice (version 3.15.0)

mice.impute.mpmm: Imputation by multivariate predictive mean matching

Description

Imputes multivariate incomplete data among which there are specific relations, for instance, polynomials, interactions, range restrictions and sum scores.

Usage

mice.impute.mpmm(data, format = "imputes", ...)

Value

A matrix with imputed data, which has ncol(y) columns and sum(wy) rows.

Arguments

data

matrix with exactly two missing data patterns

format

A character vector specifying the type of object that should be returned. The default is format = "imputes".

...

Other named arguments.

Author

Mingyang Cai and Gerko Vink

Details

This function implements the predictive mean matching and applies canonical regression analysis to select donors fora set of missing variables. In general, canonical regressionanalysis looks for a linear combination of covariates that predicts a linear combination of outcomes (a set of missing variables) optimally in a least-square sense (Israels, 1987). The predicted value of the linear combination of the set of missing variables would be applied to perform predictive mean matching.

See Also

mice.impute.pmm Van Buuren, S. (2018). Flexible Imputation of Missing Data. Second Edition. Chapman & Hall/CRC. Boca Raton, FL.

Other univariate imputation functions: mice.impute.cart(), mice.impute.lasso.logreg(), mice.impute.lasso.norm(), mice.impute.lasso.select.logreg(), mice.impute.lasso.select.norm(), mice.impute.lda(), mice.impute.logreg.boot(), mice.impute.logreg(), mice.impute.mean(), mice.impute.midastouch(), mice.impute.mnar.logreg(), mice.impute.norm.boot(), mice.impute.norm.nob(), mice.impute.norm.predict(), mice.impute.norm(), mice.impute.pmm(), mice.impute.polr(), mice.impute.polyreg(), mice.impute.quadratic(), mice.impute.rf(), mice.impute.ri()

Examples

Run this code
require(lattice)

# Create Data
B1 <- .5
B2 <- .5
X <- rnorm(1000)
XX <- X^2
e <- rnorm(1000, 0, 1)
Y <- B1 * X + B2 * XX + e
dat <- data.frame(x = X, xx = XX, y = Y)

# Impose 25 percent MCAR Missingness
dat[0 == rbinom(1000, 1, 1 - .25), 1:2] <- NA

# Prepare data for imputation
blk <- list(c("x", "xx"), "y")
meth <- c("mpmm", "")

# Impute data
imp <- mice(dat, blocks = blk, method = meth, print = FALSE)

# Pool results
pool(with(imp, lm(y ~ x + xx)))

# Plot results
stripplot(imp)
plot(dat$x, dat$xx, col = mdc(1), xlab = "x", ylab = "xx")
cmp <- complete(imp)
points(cmp$x[is.na(dat$x)], cmp$xx[is.na(dat$x)], col = mdc(2))

Run the code above in your browser using DataLab