mice.impute.rfpred.norm {RfEmpImp} | R Documentation |
Univariate sampler function for continuous variables for prediction-based imputation, assuming normality for prediction errors of random forest
Description
Please note that functions with names starting with "mice.impute" are exported to be visible for the mice sampler functions. Please do not call these functions directly unless you know exactly what you are doing.
For continuous variables only.
This function is for RfPred.Norm
multiple imputation method, adapter for mice
samplers.
In the mice()
function, set method = "rfpred.norm"
to call it.
The function performs multiple imputation based on normality assumption using out-of-bag mean squared error as the estimate for the variance.
Usage
mice.impute.rfpred.norm(
y,
ry,
x,
wy = NULL,
num.trees.cont = 10,
norm.err.cont = TRUE,
alpha.oob = 0,
pre.boot = TRUE,
num.threads = NULL,
...
)
Arguments
y |
Vector to be imputed. |
ry |
Logical vector of length |
x |
Numeric design matrix with |
wy |
Logical vector of length |
num.trees.cont |
Number of trees to build for continuous variables.
The default is |
norm.err.cont |
Use normality assumption for prediction errors of random
forests. The default is |
alpha.oob |
The "significance level" for individual out-of-bag
prediction errors used for the calculation for out-of-bag mean squared error,
useful when presence of extreme values.
For example, set alpha = 0.05 to use 95% confidence level.
The default is |
pre.boot |
If |
num.threads |
Number of threads for parallel computing. The default is
|
... |
Other arguments to pass down. |
Details
RfPred.Norm
imputation sampler.
Value
Vector with imputed data, same type as y
, and of length
sum(wy)
.
Author(s)
Shangzhi Hong
References
Shah, Anoop D., et al. "Comparison of random forest and parametric imputation models for imputing missing data using MICE: a CALIBER study." American journal of epidemiology 179.6 (2014): 764-774.
Examples
# Users can set method = "rfpred.norm" in call to mice to use this method
data("airquality")
impObj <- mice(airquality, method = "rfpred.norm", m = 5,
maxit = 5, maxcor = 1.0, eps = 0,
remove.collinear = FALSE, remove.constant = FALSE,
printFlag = FALSE)