Learn R Programming

VIM (version 7.3.0)

vimmi: VIM Multiple Imputations (vimmi)

Description

S3 class for storing multiple imputations from vimpute. Stores the original data once and only the imputed values per variable per imputation, for memory efficiency.

Usage

# S3 method for vimmi
print(x, ...)

# S3 method for vimmi summary(object, ...)

Arguments

x

A vimmi object

...

Currently unused

object

A vimmi object

Author

Matthias Templ

Details

A vimmi object is returned by vimpute when m > 1. It contains:

data

The original data.frame with NAs intact (stored once).

imp

Named list: for each variable with missings, a data.frame with nmis rows and m columns of imputed values.

where

Logical matrix indicating which cells were imputed.

m

Integer: number of imputations.

nmis

Named integer vector of missing counts per variable.

method

Named list of imputation methods used per variable.

boot

Logical: was bootstrap resampling used?

uncert

Character: uncertainty method used.

call

The original function call.

tuning_log

Tuning report of the (single) tuning run, or NULL.

chain

Per-iteration chain statistics (mean/var arrays [variable, iteration, imputation]) behind plot.vimmi trace plots.

seed

The seed applied at entry, or NULL.

Use vim_complete to extract completed datasets, with.vimmi to fit models across imputations (returns a mice-compatible mira), vim_as_mids to convert to a mice mids object for pooling with mice::pool(), and plot.vimmi for convergence trace plots.

See Also

vimpute, vim_complete, with.vimmi, vim_as_mids, plot.vimmi

Other imputation methods: hotdeck(), impPCA(), imputeCellEM(), imputeCellIRMI(), imputeCellM(), imputeCellMCD(), imputeCellwise(), imputeRobust(), imputeRobustChain(), irmi(), kNN(), matchImpute(), medianSamp(), rangerImpute(), regressionImp(), sampleCat(), vimpute(), xgboostImpute()

Examples

Run this code
if (FALSE) {
# Multiple imputation with bootstrap and normal error uncertainty
result <- vimpute(sleep, method = "ranger", m = 5,
                  boot = TRUE, uncert = "normalerror")
print(result)
summary(result)

# Extract completed datasets
d1 <- vim_complete(result, 1)
all_d <- vim_complete(result, "all")
# complete(result, 1) does the same when mice or tidyr is attached

# Fit models and pool
fits <- with(result, lm(Sleep ~ Dream + Span))
# mice::pool(fits)  # requires mice
}

Run the code above in your browser using DataLab