File: mice.impute.mpmm.Rd

package info (click to toggle)
r-cran-mice 3.17.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,380 kB
  • sloc: cpp: 121; sh: 25; makefile: 2
file content (94 lines) | stat: -rw-r--r-- 3,160 bytes parent folder | download
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mice.impute.mpmm.R
\name{mice.impute.mpmm}
\alias{mice.impute.mpmm}
\alias{mpmm}
\title{Imputation by multivariate predictive mean matching}
\usage{
mice.impute.mpmm(data, format = "imputes", ...)
}
\arguments{
\item{data}{matrix with exactly two missing data patterns}

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

\item{...}{Other named arguments.}
}
\value{
A matrix with imputed data, which has \code{ncol(y)} columns and
\code{sum(wy)} rows.
}
\description{
Imputes multivariate incomplete data among which there are specific relations,
for instance, polynomials, interactions, range restrictions and sum scores.
}
\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.
}
\note{
The function requires variables in the block have the same missingness pattern.
If there are more than one missingness pattern, the function will return
a warning.
}
\examples{
# simulate data
beta2 <- beta1 <- .5
x <- rnorm(1000)
e <- rnorm(1000, 0, 1)
y <- beta1 * x + beta2 * x^2 + e
dat <- data.frame(y = y, x = x, x2 = x^2)
m <- as.logical(rbinom(1000, 1, 0.25))
dat[m, c("x", "x2")] <- NA

# impute
blk <- list("y", c("x", "x2"))
meth <- c("", "mpmm")
imp <- mice(dat, blocks = blk, method = meth, print = FALSE,
    m = 2, maxit = 2)

# analyse and check
summary(pool(with(imp, lm(y ~ x + x2))))
with(dat, plot(x, x2, col = mdc(1)))
with(complete(imp), points(x[m], x2[m], col = mdc(2)))
}
\seealso{
\code{\link{mice.impute.pmm}}
Van Buuren, S. (2018).
\href{https://stefvanbuuren.name/fimd/sec-knowledge.html#sec:quadratic}{\emph{Flexible Imputation of Missing Data. Second Edition.}}
Chapman & Hall/CRC. Boca Raton, FL.

Other univariate imputation functions: 
\code{\link{mice.impute.cart}()},
\code{\link{mice.impute.lasso.logreg}()},
\code{\link{mice.impute.lasso.norm}()},
\code{\link{mice.impute.lasso.select.logreg}()},
\code{\link{mice.impute.lasso.select.norm}()},
\code{\link{mice.impute.lda}()},
\code{\link{mice.impute.logreg}()},
\code{\link{mice.impute.logreg.boot}()},
\code{\link{mice.impute.mean}()},
\code{\link{mice.impute.midastouch}()},
\code{\link{mice.impute.mnar.logreg}()},
\code{\link{mice.impute.norm}()},
\code{\link{mice.impute.norm.boot}()},
\code{\link{mice.impute.norm.nob}()},
\code{\link{mice.impute.norm.predict}()},
\code{\link{mice.impute.pmm}()},
\code{\link{mice.impute.polr}()},
\code{\link{mice.impute.polyreg}()},
\code{\link{mice.impute.quadratic}()},
\code{\link{mice.impute.rf}()},
\code{\link{mice.impute.ri}()}
}
\author{
Mingyang Cai and Gerko Vink
}
\concept{univariate imputation functions}
\keyword{datagen}