Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

07complete

Extract the Completed Data


Description

This function extracts several multiply imputed data.frames from an object of mi-class.

Usage

complete(y, m, ...)

Arguments

y

An object of mi-class (typically) or missing_data.frame-class or missing_variable-class

m

If y is an object of mi-class, then m must be a specified integer indicating how many multiply imputed data.frames to return or, if missing, the number of data.frames will be equal to the length of the data slot in y. If y is not an object of mi-class, then m must be a specified integer indicating which iteration to use in the resulting data.frame, where any non-positive integer is a short hand for the last iteration.

...

Other arguments, not currently utilized

Details

Several functions within mi use complete, although the only reason in principle why a user should need to call complete is to create data.frames to export to another program. For analysis, it is better to use the pool function, although currently pool might not offer all the necessary functionality.

Value

If y is an object of mi-class and m > 1, a list of m data.frames is returned. Otherwise, a single data.frame is returned.

Author(s)

Ben Goodrich and Jonathan Kropko, for this version, based on earlier versions written by Yu-Sung Su, Masanao Yajima, Maria Grazia Pittau, Jennifer Hill, and Andrew Gelman.

See Also

Examples

if(!exists("imputations", env = .GlobalEnv)) {
  imputations <- mi:::imputations # cached from example("mi-package")
}
data.frames <- complete(imputations, 3)
lapply(data.frames, summary)

mi

Missing Data Imputation and Model Checking

v1.0
GPL (>= 2)
Authors
Andrew Gelman [ctb], Jennifer Hill [ctb], Yu-Sung Su [aut], Masanao Yajima [ctb], Maria Pittau [ctb], Ben Goodrich [cre, aut], Yajuan Si [ctb], Jon Kropko [aut]
Initial release
2015-04-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.