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

mitmlComplete

Extract imputed data sets


Description

This function extracts imputed data sets from mitml class objects as produced by panImpute and jomoImpute.

Usage

mitmlComplete(x, print = "all", force.list = FALSE)

Arguments

x

An object of class mitml as produced by panImpute or jomoImpute.

print

Either an integer vector, "list", or "all" denoting which data sets to extract. If set to "list" or "all", all imputed data sets will be returned as a list. Negative values and zero return the original (incomplete) data set. Default is "all".

force.list

(optional) Logical flag indicating if single data sets should be enclosed in a list. Default is FALSE.

Value

Usually a list of imputed data with class mitml.list If only one data set is extracted: a data frame unless force.list = TRUE.

Author(s)

Simon Grund

See Also

Examples

data(studentratings)

fml <- ReadDis + SES ~ ReadAchiev + (1|ID)
imp <- panImpute(studentratings, formula = fml, n.burn = 1000, n.iter = 100, m = 5)

# extract original (incomplete) data set
mitmlComplete(imp, print = 0)

# extract first imputed data set (returned as mitml.list)
mitmlComplete(imp, print = 1, force.list = TRUE)

# extract all imputed data sets at once
implist <- mitmlComplete(imp, print = "all")

## Not run: 
# ... alternatives with same results
implist <- mitmlComplete(imp, print = 1:5)
implist <- mitmlComplete(imp, print = "list")

## End(Not run)

mitml

Tools for Multiple Imputation in Multilevel Modeling

v0.4-1
GPL (>= 2)
Authors
Simon Grund [aut,cre], Alexander Robitzsch [aut], Oliver Luedtke [aut]
Initial release
2021-02-05

We don't support your browser anymore

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