Last data update: 2014.03.03

R: Convert imputations from long format to 'mitml.list'
long2mitml.listR Documentation

Convert imputations from long format to mitml.list

Description

These functions convert data sets containing multiple imputations in long format to objects of class mitml.list for use in further analyses.

Usage


long2mitml.list(x, split, exclude=NULL)

jomo2mitml.list(x)

Arguments

x

A data frame in long format containing multiple imputations (see details).

split

A character string naming the column in x that denotes different imputatins (see details).

exclude

A vector denoting values of split which should be excluded from the list.

Details

The general function long2mitml.list is intedended for converting data frames from the long format to mitml.list (i.e., a list of imputed data sets). In this format, imputations are enclosed in a single data frame where some split variables is used to denote different imputations.

The function jomo2mitml.list is a special case of long2mitml.list and is intended for converting imputations generated with the native functions of the jomo package.

Value

A list of imputed data sets with an additional class attribute mitml.list.

Author(s)

Simon Grund

See Also

mitmlComplete

Examples

data(studentratings)
require(jomo)

# impute data using jomo (native functions)
clus <- studentratings[,"ID"]
imp <- jomo(Y=studentratings[,c("ReadAchiev","ReadDis")], clus=clus)

# split imputations
impList <- long2mitml.list(imp, split="Imputation", exclude=0)
impList <- jomo2mitml.list(imp)

Results