simongrund1/mitml

feature request: mitml.list2mids and mids2mitml

Opened this issue · 2 comments

It would sometimes be helpful to be able to switch back and forth between mitml.list, mitml, and mids objects. mitml.lists are most helpful for post-processing using dplyr, but many more out-of-the-box diagnostics can be used on mitml and mids objects.

That's a great idea. I'll see what I can do about that. Converting "mitml.list" to "mitml" may be difficult, because the "mitml.list" saves only the imputed data, whereas "mitml" includes model information, MCMC samples for model parameters, etc. But I suppose it would make sense to include with and within methods for "mitml" that don't require converting into a list first.

For converting to "mids", you can have a look at mice::as.mids. This function can be used with any list of imputed data sets but also requires the original (incomplete) data. Unfortunately, because mice depends on mitml, I can't write methods for "mitml" or "mitml.list" objects that use as.mids internally, because that would create a depency cycle.

For converting to "mids", you can have a look at mice::as.mids. This function can be used with any list of imputed data sets but also requires the original (incomplete) data. Unfortunately, because mice depends on mitml, I can't write methods for "mitml" or "mitml.list" objects that use as.mids internally, because that would create a depency cycle.

If needed, I think that one can use requireNamespace("mice") for locally attaching the as.mids function. `The mice package must only appear as "Suggests", not "Imports".