View source: R/mice.impute.simputation.R
mice.impute.simputation | R Documentation |
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, ... )
y |
Incomplete data vector of length |
ry |
Vector of missing data pattern ( |
x |
Matrix ( |
Fun |
Name of imputation functions in simputation package, e.g.,
|
Fun_args |
Optional argument list for |
... |
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.
## Not run:
#############################################################################
# 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)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.