vim_as_mids: Convert a vimmi object to a mice mids object

View source: R/vimmi.R

vim_as_midsR Documentation

Convert a vimmi object to a mice mids object

Description

Converts a vimmi object to long format and uses mice::as.mids() to create a proper mids object. This enables use of mice::pool(), mice::with.mids(), and other mice infrastructure.

Usage

vim_as_mids(x, ...)

as.mids.vimmi(x, ...)

Arguments

x

A vimmi object

...

Currently unused

Details

vim_as_mids() is the documented name. as.mids.vimmi() is the same function under its historical name (kept for backward compatibility): despite the dotted suffix it is a plain function, not an S3 method – mice::as.mids() is not a generic, so it never dispatches on vimmi objects.

Value

A mids object (from the mice package)

Examples

## Not run: 
result <- vimpute(sleep, method = "ranger", m = 5,
                  boot = TRUE, uncert = "normalerror")
mids_obj <- vim_as_mids(result)
# Now use mice infrastructure:
# fits <- with(mids_obj, lm(Sleep ~ Dream + Span))
# mice::pool(fits)

## End(Not run)

VIM documentation built on Sept. 2, 2026, 5:07 p.m.