Applies an expression (typically a model fit) to each completed dataset in a vimmi object. The results can be pooled using mice::pool() or mitools::MIcombine().

# S3 method for class 'vimmi'
with(data, expr, ...)

Arguments

data

A vimmi object

expr

An expression to evaluate, e.g. lm(y ~ x)

...

Currently unused

Value

A list of length m containing the result of evaluating expr on each completed dataset

Examples

if (FALSE) { # \dontrun{
result <- vimpute(sleep, method = "ranger", m = 5, boot = TRUE, uncert = "normalerror")
fits <- with(result, lm(Sleep ~ Dream + Span))
# Pool with mice:
# mice::pool(fits)
} # }