Learn R Programming

mitml (version 0.3-1)

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=0, force.list=FALSE)

Arguments

x
An object of class mitml as produced by panImpute and jomoImpute.
print
Either an integer vector, "list", or "all" denoting which data sets to extract. If set to "all" or "list", then all imputed data sets will be returned as a list. Negative values and zero will return the
force.list
(optional) Logical flag indicating if single data sets should be enclosed in a list. Default is to FALSE.

Value

  • Single data sets are returned as a data frame unless force.list=TRUE. If several data sets are extracted, the result is always a list of data sets with an additional class attribute mitml.list.

See Also

panImpute,jomoImpute

Examples

Run this code
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 single imputed data set (first one, returned as mitml.list)
mitmlComplete(imp, print=1, force.list=TRUE)

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

# ... alternatives with same results
implist <- mitmlComplete(imp, print="all")
implist <- mitmlComplete(imp, print="list")

Run the code above in your browser using DataLab