complete.miceadds: Creates Imputed Dataset from a 'mids.nmi' or 'mids.1chain'...

Description Usage Arguments Author(s) See Also Examples

Description

Creates imputed dataset from a mids.nmi or mids.1chain object.

Usage

1
2
3
complete.mids.nmi( x , action = c(1,1) )

complete.mids.1chain( x , action = 1 )

Arguments

x

Object of class mids.nmi (for complete.mids.nmi) or mids.1chain (for complete.mids.1chain)

action

A vector of length two indicating to indices of between and within imputed dataset for for complete.mids.nmi and an integer for the index of imputed dataset for complete.mids.1chain.

Author(s)

Alexander Robitzsch

See Also

See also the corresponding mice::complete function and mitml::mitmlComplete.

Imputation methods: mice.nmi, mice.1chain

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
34
35
36
37
38
39
40
41
42
43
44
45
## Not run: 
#############################################################################
# EXAMPLE 1: Nested multiple imputation and dataset extraction for TIMSS data
#############################################################################

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) ]
                }
                
#***************
# (1) nested multiple imputation using mice
imp1 <- mice.nmi( datlist ,  m=4 , maxit=3 )
summary(imp1)

#***************
# (2) nested multiple imputation using mice.1chain
imp2 <- mice.nmi( datlist , Nimp=4 , burnin=10 ,iter=22, type="mice.1chain")
summary(imp2)

#**************
# extract dataset for third orginal dataset the second within imputation
dat32a <- complete.mids.nmi( imp1 , action = c(3,2) )
dat32b <- complete.mids.nmi( imp2 , action = c(3,2) )

#############################################################################
# EXAMPLE 2: Imputation from one chain and extracting dataset for nhanes data
#############################################################################

library(mice)
data(nhanes, package="mice")

# nhanes data in one chain
imp1 <- mice.1chain( nhanes , burnin=5 , iter=40 , Nimp=4 ,
          imputationMethod=rep("norm" , 4 ) )
    
# extract first imputed dataset
dati1 <- complete.mids.1chain( imp1 , action=1 )

## End(Not run)


Search within the miceadds package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.