Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mice.impute.imputeR.lmFun

Wrapper Function to Imputation Methods in the imputeR Package


Description

The imputation methods "imputeR.lmFun" and "imputeR.cFun" provide interfaces to imputation methods in the imputeR package for continuous and binary data, respectively.

Usage

mice.impute.imputeR.lmFun(y, ry, x, Fun=NULL, draw_boot=TRUE, add_noise=TRUE, ... )

mice.impute.imputeR.cFun(y, ry, x, Fun=NULL, draw_boot=TRUE, ... )

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 imputeR package, e.g., imputeR::ridgeR, see Details.

draw_boot

Logical indicating whether a Bootstrap sample is taken for sampling model parameters

add_noise

Logical indicating whether empirical residuals should be added to predicted values

...

Further arguments to be passed

Details

Methods for continuous variables:

Value

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

Examples

## Not run: 
#############################################################################
# EXAMPLE 1: Example with binary and continuous variables
#############################################################################

library(mice)
library(imputeR)

data(nhanes, package="mice")
dat <- nhanes
dat$hyp <- as.factor(dat$hyp)

#* define imputation methods
method <- c(age="",bmi="norm",hyp="imputeR.cFun",chl="imputeR.lmFun")
Fun <- list( hyp=imputeR::ridgeC, chl=imputeR::ridgeR)

#** do imputation
imp <- mice::mice(dat1, method=method, maxit=10, m=4, Fun=Fun)
summary(imp)

## End(Not run)

miceadds

Some Additional Multiple Imputation Functions, Especially for 'mice'

v3.11-6
GPL (>= 2)
Authors
Alexander Robitzsch [aut,cre] (<https://orcid.org/0000-0002-8226-3132>), Simon Grund [aut] (<https://orcid.org/0000-0002-1290-8986>), Thorsten Henke [ctb]
Initial release
2021-01-21 11:48:47

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.