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)
}
Run the code above in your browser using DataLab