| long2mitml.list {mitml} | R Documentation |
mitml.listThese functions convert data sets containing multiple imputations in long format to objects of class mitml.list. The resulting object can be used in further analyses.
long2mitml.list(x, split, exclude=NULL) jomo2mitml.list(x)
x |
A data frame in long format containing multiple imputations (see details). |
split |
A character string denoting the column in |
exclude |
A vector denoting values of |
The 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, and a split variable is used to identify different imputations.
Similarly, jomo2mitml.list is a special case of long2mitml.list intended for converting imputations that have been generated with jomo directly.
A list of imputed data sets with an additional class attribute mitml.list.
Simon Grund
data(studentratings)
require(jomo)
# impute data using jomo (native functions)
clus <- studentratings[,"ID"]
Y <- studentratings[,c("ReadAchiev","ReadDis")]
imp <- jomo(Y=Y, clus=clus, nburn=1000, nbetween=100, nimp=5)
# split imputations
impList <- long2mitml.list(imp, split="Imputation", exclude=0)
impList <- jomo2mitml.list(imp)