Learn R Programming

Amelia (version 1.8.1)

with.amelia: Execute commands within each imputed data set

Description

Evaluate an R expression in the environments constructed from the imputed data sets of a call to amelia function.

Usage

# S3 method for amelia
with(data, expr, ...)

Value

a list the same length as data$imputations that contains the output of the expression as evaluated in each imputed data set of data.

Arguments

data

imputation output from the amelia funtion.

expr

expression to evaluate in each imputed data set in data.

...

arguments to be passed to (future) methods.

Author

Matt Blackwell

Examples

Run this code
data(africa)
a.out <- amelia(x = africa, cs = "country", ts = "year", logs =
"gdp_pc")

imp.mods <- with(a.out, lm(gdp_pc ~ infl + trade))

mi.combine(imp.mods, conf.int = TRUE)

Run the code above in your browser using DataLab