-
Notifications
You must be signed in to change notification settings - Fork 110
/
Copy pathmice.impute.panImpute.Rd
95 lines (85 loc) · 3.19 KB
/
mice.impute.panImpute.Rd
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
95
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mice.impute.panImpute.R
\name{mice.impute.panImpute}
\alias{mice.impute.panImpute}
\title{Impute multilevel missing data using \code{pan}}
\usage{
mice.impute.panImpute(
data,
formula,
type,
m = 1,
silent = TRUE,
format = "imputes",
...
)
}
\arguments{
\item{data}{A data frame containing incomplete and auxiliary variables,
the cluster indicator variable, and any other variables that should be
present in the imputed datasets.}
\item{formula}{A formula specifying the role of each variable
in the imputation model. The basic model is constructed
by \code{model.matrix}, thus allowing to include derived variables
in the imputation model using \code{I()}. See
\code{\link[mitml]{panImpute}}.}
\item{type}{An integer vector specifying the role of each variable
in the imputation model (see \code{\link[mitml]{panImpute}})}
\item{m}{The number of imputed data sets to generate.}
\item{silent}{(optional) Logical flag indicating if console output should be suppressed. Default is to \code{FALSE}.}
\item{format}{A character vector specifying the type of object that should
be returned. The default is \code{format = "list"}. No other formats are
currently supported.}
\item{...}{Other named arguments: \code{n.burn}, \code{n.iter},
\code{group}, \code{prior}, \code{silent} and others.}
}
\value{
A list of imputations for all incomplete variables in the model,
that can be stored in the the \code{imp} component of the \code{mids}
object.
}
\description{
This function is a wrapper around the \code{panImpute} function
from the \code{mitml} package so that it can be called to
impute blocks of variables in \code{mice}. The \code{mitml::panImpute}
function provides an interface to the \code{pan} package for
multiple imputation of multilevel data (Schafer & Yucel, 2002).
Imputations can be generated using \code{type} or \code{formula},
which offer different options for model specification.
}
\note{
The number of imputations \code{m} is set to 1, and the function
is called \code{m} times so that it fits within the \code{mice}
iteration scheme.
This is a multivariate imputation function using a joint model.
}
\examples{
blocks <- list(c("bmi", "chl", "hyp"), "age")
method <- c("panImpute", "pmm")
ini <- mice(nhanes, blocks = blocks, method = method, maxit = 0)
pred <- ini$pred
pred["B1", "hyp"] <- -2
imp <- mice(nhanes, blocks = blocks, method = method, pred = pred, maxit = 1)
}
\references{
Grund S, Luedtke O, Robitzsch A (2016). Multiple
Imputation of Multilevel Missing Data: An Introduction to the R
Package \code{pan}. SAGE Open.
Schafer JL (1997). Analysis of Incomplete Multivariate Data. London:
Chapman & Hall.
Schafer JL, and Yucel RM (2002). Computational strategies for
multivariate linear mixed-effects models with missing values.
Journal of Computational and Graphical Statistics, 11, 437-457.
}
\seealso{
\code{\link[mitml]{panImpute}}
Other multivariate-2l:
\code{\link{mice.impute.jomoImpute}()}
}
\author{
Stef van Buuren, 2018, building on work of Simon Grund,
Alexander Robitzsch and Oliver Luedtke (authors of \code{mitml} package)
and Joe Schafer (author of \code{pan} package).
}
\concept{multivariate-2l}
\keyword{datagen}