-
Notifications
You must be signed in to change notification settings - Fork 106
/
mice.impute.rf.Rd
118 lines (109 loc) · 4.09 KB
/
mice.impute.rf.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mice.impute.rf.R
\name{mice.impute.rf}
\alias{mice.impute.rf}
\title{Imputation by random forests}
\usage{
mice.impute.rf(
y,
ry,
x,
wy = NULL,
ntree = 10,
rfPackage = c("ranger", "randomForest"),
...
)
}
\arguments{
\item{y}{Vector to be imputed}
\item{ry}{Logical vector of length \code{length(y)} indicating the
the subset \code{y[ry]} of elements in \code{y} to which the imputation
model is fitted. The \code{ry} generally distinguishes the observed
(\code{TRUE}) and missing values (\code{FALSE}) in \code{y}.}
\item{x}{Numeric design matrix with \code{length(y)} rows with predictors for
\code{y}. Matrix \code{x} may have no missing values.}
\item{wy}{Logical vector of length \code{length(y)}. A \code{TRUE} value
indicates locations in \code{y} for which imputations are created.}
\item{ntree}{The number of trees to grow. The default is 10.}
\item{rfPackage}{A single string specifying the backend for estimating the
random forest. The default backend is the \code{ranger} package. The only
alternative currently implemented is the \code{randomForest} package, which
used to be the default in mice 3.13.10 and earlier.}
\item{\dots}{Other named arguments passed down to
\code{mice:::install.on.demand()}, \code{randomForest::randomForest()},
\code{randomForest:::randomForest.default()}, and \code{ranger::ranger()}.}
}
\value{
Vector with imputed data, same type as \code{y}, and of length
\code{sum(wy)}
}
\description{
Imputes univariate missing data using random forests.
}
\details{
Imputation of \code{y} by random forests. The method
calls \code{randomForrest()} which implements Breiman's random forest
algorithm (based on Breiman and Cutler's original Fortran code)
for classification and regression. See Appendix A.1 of Doove et al.
(2014) for the definition of the algorithm used.
}
\note{
An alternative implementation was independently
developed by Shah et al (2014). This were available as
functions \code{CALIBERrfimpute::mice.impute.rfcat} and
\code{CALIBERrfimpute::mice.impute.rfcont} (now archived).
Simulations by Shah (Feb 13, 2014) suggested that
the quality of the imputation for 10 and 100 trees was identical,
so mice 2.22 changed the default number of trees from \code{ntree = 100} to
\code{ntree = 10}.
}
\examples{
\dontrun{
imp <- mice(nhanes2, meth = "rf", ntree = 3)
plot(imp)
}
}
\references{
Doove, L.L., van Buuren, S., Dusseldorp, E. (2014), Recursive partitioning
for missing data imputation in the presence of interaction Effects.
Computational Statistics & Data Analysis, 72, 92-104.
Shah, A.D., Bartlett, J.W., Carpenter, J., Nicholas, O., Hemingway, H. (2014),
Comparison of random forest and parametric imputation models for
imputing missing data using MICE: A CALIBER study. American Journal
of Epidemiology, \doi{10.1093/aje/kwt312}.
Van Buuren, S. (2018).
\href{https://stefvanbuuren.name/fimd/sec-cart.html}{\emph{Flexible Imputation of Missing Data. Second Edition.}}
Chapman & Hall/CRC. Boca Raton, FL.
}
\seealso{
\code{\link{mice}}, \code{\link{mice.impute.cart}},
\code{\link[randomForest]{randomForest}}
\code{\link[ranger]{ranger}}
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.boot}()},
\code{\link{mice.impute.logreg}()},
\code{\link{mice.impute.mean}()},
\code{\link{mice.impute.midastouch}()},
\code{\link{mice.impute.mnar.logreg}()},
\code{\link{mice.impute.mpmm}()},
\code{\link{mice.impute.norm.boot}()},
\code{\link{mice.impute.norm.nob}()},
\code{\link{mice.impute.norm.predict}()},
\code{\link{mice.impute.norm}()},
\code{\link{mice.impute.pmm}()},
\code{\link{mice.impute.polr}()},
\code{\link{mice.impute.polyreg}()},
\code{\link{mice.impute.quadratic}()},
\code{\link{mice.impute.ri}()}
}
\author{
Lisa Doove, Stef van Buuren, Elise Dusseldorp, 2012; Patrick Rockenschaub, 2021
}
\concept{univariate imputation functions}
\keyword{datagen}