mice.impute.simputation.Rd
This imputation method provides a wrapper function to univariate imputation methods in the simputation package.
mice.impute.simputation(y, ry, x, Fun=NULL, Fun_args=NULL, ... )
Incomplete data vector of length n
Vector of missing data pattern (FALSE
-- missing,
TRUE
-- observed)
Matrix (n
x p
) of complete covariates.
Name of imputation functions in simputation package, e.g.,
imputeR::impute_lm
, see Details.
Optional argument list for Fun
Further arguments to be passed
Selection of imputation methods included in the simputation package:
linear regression: simputation::impute_lm
,
robist linear regression with M-estimators:
simputation::impute_rlm
,
regularized regression with lasso/elasticnet/ridge regression:
simputation::impute_en
,
CART models or random forests:
simputation::impute_cart
,
simputation::impute_rf
,
Hot deck imputation:
simputation::impute_rhd
,
simputation::impute_shd
,
Predictive mean matching:
simputation::impute_pmm
,
k-nearest neighbours imputation:
simputation::impute_knn
A vector of length nmis=sum(!ry)
with imputed values.
if (FALSE) {
#############################################################################
# EXAMPLE 1: Nhanes example
#############################################################################
library(mice)
library(simputation)
data(nhanes, package="mice")
dat <- nhanes
#** imputation methods
method <- c(age="",bmi="norm", hyp="norm", chl="simputation")
Fun <- list( chl=simputation::impute_lm)
Fun_args <- list( chl=list(add_residual="observed") )
#** do imputations
imp <- mice::mice(dat, method=method, Fun=Fun, Fun_args=Fun_args)
summary(imp)
}