mlim.mids {mlim}R Documentation

prepare "mids" class object

Description

takes "mlim" object and prepares a "mids" class for data analysis with multiple imputation.

Usage

mlim.mids(mlim, incomplete)

Arguments

mlim

array of class "mlim", returned by "mlim" function

incomplete

the original data.frame with NAs

Value

object of class 'mids', as required by 'mice' package for analyzing multiple imputation data

Author(s)

E. F. Haghish, based on code from 'prelim' frunction in missMDA R package

Examples


## Not run: 
data(iris)
require(mice)
irisNA <- mlim.na(iris, p = 0.1, seed = 2022)

# adding unstratified NAs to all variables of a data.frame
MLIM <- mlim(irisNA, m=5, tuning_time = 180, doublecheck = T, seed = 2022)

# create the mids object for MICE package
mids <- mlim.mids(MLIM, irisNA)

# run an analysis on the mids data (just as example)
fit <- with(data=mids, exp=glm(Species~ Sepal.Length, family = "binomial"))

# then, pool the results!
summary(pool(fit))

## End(Not run)

[Package mlim version 0.3.0 Index]