NestedImputationList: Functions for Analysis of Nested Multiply Imputed Datasets

Description Usage Arguments Value Author(s) See Also Examples

View source: R/NestedImputationList.R

Description

The function NestedImputationList takes a list of lists of datasets and converts this into an object of class NestedImputationList.

Statistical models can be estimated with the function with.NestedImputationList.

The mitools::MIcombine method can be used for objects of class NestedImputationResultList which are the output of with.NestedImputationList.

Usage

1
2
3
4
5
6
7
NestedImputationList( datasets )

## S3 method for class 'NestedImputationList'
print(x , ...)

## S3 method for class 'NestedImputationResultList'
MIcombine(results, ...)

Arguments

datasets

List of lists of datasets which are created by nested multiple imputation.

x

Object of class NestedImputationResultsList

results

Object of class NestedImputationResultsList

...

Further arguments to be passed.

Value

Function NestedImputationList: Object of class NestedImputationList.

Function MIcombine.NestedImputationList: Object of class mipo.nmi.

Author(s)

Alexander Robitzsch

See Also

with.NestedImputationList, within.NestedImputationList, pool.mids.nmi, NMIcombine

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
## Not run: 
#############################################################################
# EXAMPLE 1: Nested multiple imputation and conversion into an object of class
#            NestedImputationList 
#############################################################################

library(BIFIEsurvey)
data(data.timss2 , package="BIFIEsurvey" )
datlist <- data.timss2      

# remove first four variables
M <- length(datlist)
for (ll in 1:M){
    datlist[[ll]] <- datlist[[ll]][ , -c(1:4) ]
                }
                
# nested multiple imputation using mice
imp1 <- miceadds::mice.nmi( datlist ,  m=3 , maxit=2 )
summary(imp1)

# create object of class NestedImputationList
datlist1 <- miceadds::mids2datlist( imp1 )
datlist1 <- miceadds::NestedImputationList( datlist1 )

# estimate linear model using with
res1 <- with( datlist1 , stats::lm( ASMMAT ~ female + migrant ) )
# pool results
mres1 <- mitools::MIcombine( res1 )
summary(mres1)
coef(mres1)
vcov(mres1)

## End(Not run)

miceadds documentation built on Aug. 9, 2017, 5:04 p.m.