data(studentratings)
fml <- ReadDis + SES ~ ReadAchiev + (1|ID)
imp <- panImpute(studentratings, formula = fml, n.burn = 1000, n.iter = 100, m = 5)
implist <- mitmlComplete(imp)
# * Example 1: simple conversion
# convert to 'mids'
impmids <- mitml.list2mids(implist, data = studentratings)
# * Example 2: conversion with additional variables
# compute new variables
implist <- within(implist, {
M.ReadAchiev <- clusterMeans(ReadAchiev, ID)
C.ReadAchiev <- ReadAchiev - M.ReadAchiev
})
# convert to 'mids'
impmids <- mitml.list2mids(implist, data = studentratings, fill = TRUE)
Run the code above in your browser using DataLab