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.

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

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

Arguments

x

A vimmi object

...

Currently unused

object

A vimmi object

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.

Use complete.vimmi to extract completed datasets, with.vimmi to fit models across imputations, and as.mids.vimmi to convert to a mice mids object for pooling with mice::pool().

Author

Matthias Templ

Examples

if (FALSE) { # \dontrun{
# 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 <- complete(result, 1)
all_d <- complete(result, "all")

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