mice.impute.simputation: Wrapper Function to Imputation Methods in the 'simputation'...

View source: R/mice.impute.simputation.R

mice.impute.simputationR Documentation

Wrapper Function to Imputation Methods in the simputation Package

Description

This imputation method provides a wrapper function to univariate imputation methods in the simputation package.

Usage

mice.impute.simputation(y, ry, x, Fun=NULL, Fun_args=NULL, ... )

Arguments

y

Incomplete data vector of length n

ry

Vector of missing data pattern (FALSE – missing, TRUE – observed)

x

Matrix (n x p) of complete covariates.

Fun

Name of imputation functions in simputation package, e.g., imputeR::impute_lm, see Details.

Fun_args

Optional argument list for Fun

...

Further arguments to be passed

Details

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

Value

A vector of length nmis=sum(!ry) with imputed values.

Examples

## 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)

miceadds documentation built on May 29, 2024, 11:05 a.m.