mice.impute.2l.latentgroupmean.ML: Imputation of Latent and Manifest Group Means for Multilevel...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

The imputation method 2l.latentgroupmean imputes a latent group mean assuming an infinite population of subjects within a group (see Luedtke et al., 2008 or Croon & van Veldhoven, 2007). Therefore, unreliability of group means when treating subjects as indicators is taken into account.

The imputation method mice.impute.2l.groupmean just imputes (i.e. computes) the manifest group mean. See also mice::mice.impute.2lonly.mean.

The imputation method mice.impute.2l.groupmean.elim computes the group mean eliminating the subject under study from the calculation. Therefore, this imputation method will lead to different values of individuals within the same group.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
mice.impute.2l.latentgroupmean.ML(y, ry, x, type, pls.facs = NULL, 
    imputationWeights = NULL, interactions = NULL, quadratics = NULL, 
    EAP=FALSE, ...)	
	
mice.impute.2l.latentgroupmean.MCMC(y, ry, x, type, pls.facs = NULL, 
    imputationWeights = NULL, interactions = NULL, quadratics = NULL, 
    mcmc.burnin=100 , mcmc.adapt=100 , mcmc.iter=1000 , EAP=FALSE, ...)
	
mice.impute.2l.groupmean(y, ry, x, type, grmeanwarning = TRUE, ...)

mice.impute.2l.groupmean.elim(y, ry, x, type, ...)

Arguments

y

Incomplete data vector of length n

ry

Vector of missing data pattern (FALSE – missing, TRUE – observed)

x

Matrix (n x p) of complete covariates.

type

Type of predictor variables. type=-2 refers to the cluster variable, type=2 denotes a variable for which also a (latent) group mean should be calculated. Predictors with type=1 denote all other variables.

pls.facs

Number of factors used for PLS regression (optional).

imputationWeights

Optional vector of sample weights.

interactions

Vector of variable names used for creating interactions

quadratics

Vector of variable names used for creating quadratic terms

EAP

Logical indicating whether EAPs should be used for imputation. The default FALSE corresponds to sampling from the posterior distribution.

mcmc.burnin

Number of MCMC burn-in iterations.

mcmc.adapt

Number of MCMC iterations in adaptation phase.

mcmc.iter

Total number of MCMC iterations.

grmeanwarning

An optional logical indicating whether some group means cannot be calculated.

...

Further arguments to be passed.

Details

The imputation of the latent group mean uses the lme4::lmer function of the lme4 package for mice.impute.2l.latentgroupmean.ML and the MCMCglmm::MCMCglmm function of the MCMCglmm package for mice.impute.2l.latentgroupmean.ML. Latent group mean imputation also follows Mislevy (1991).

Value

A vector of length y containing imputed group means.

Author(s)

Alexander Robitzsch, Simon Grund

References

Croon, M. A., & van Veldhoven, M. J. (2007). Predicting group-level outcome variables from variables measured at the individual level: a latent variable multilevel model. Psychological Methods, 12, 45-57.

Luedtke, O., Marsh, H. W., Robitzsch, A., Trautwein, U., Asparouhov, T., & Muthen, B. (2008). The multilevel latent covariate model: a new, more reliable approach to group-level effects in contextual studies. Psychological Methods, 13, 203-229.

Mislevy, R. J. (1991). Randomization-based inference about latent variables from complex samples. Psychometrika, 56, 177-196.

See Also

mice::mice.impute.2lonly.mean

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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
## Not run: 
#############################################################################
# EXAMPLE 1: Two-level imputation data.ma05 dataset with imputation
#            of a latent group mean
#############################################################################	
	
data(data.ma05)
dat <- data.ma05

# include manifest group mean for 'Mscore'
dat$M.Mscore <- NA
# include latent group group for 'Mscore'
dat$LM.Mscore <- NA    # => LM: latent group mean

# empty imputation
imp <- mice( dat , m=0 , maxit=0 )
summary(imp)

# define predictor matrix
predM <- imp$pred
# exclude student ISs
predM[ , "idstud"] <- 0
# idclass is the cluster identifier
predM[ , "idclass" ] <- -2  

# define imputation methods
impMethod <- imp$method
# initialize with norm
impMethod <- rep( "norm" , length(impMethod) )
names(impMethod) <- names( imp$method )
impMethod[ c("idstud","idclass")] <- ""

#*****
# STUDENT LEVEL (Level 1)

# Use a random slope model for Dscore and Mscore as the imputation method.
# Here, variance homogeneity of residuals is assumed (contrary to
# the 2l.norm imputation method in the mice package).
impMethod[ c("Dscore" , "Mscore") ] <- "2l.pan"
predM[ c("Dscore","Mscore") , "misei" ] <- 2    # random slopes on 'misei'
predM[  , "idclass" ] <- -2

# For imputing 'manote' and 'denote' use contextual effects (i.e. cluster means)
# of variables 'misei' and 'migrant'
impMethod[ c("denote" , "manote") ] <- "2l.contextual.pmm"
predM[ c("denote" , "manote") , c("misei","migrant")] <- 2

# Use no cluster variable 'idclass' for imputation of 'misei'
impMethod[ "misei"] <- "norm"
predM[ "misei" , "idclass"] <- 0 # use no multilevel imputation model

# Variable migrant: contextual effects of Dscore and misei
impMethod[ "migrant"] <- "2l.contextual.pmm"
predM[ "migrant" , c("Dscore" ,  "misei" ) ] <- 2
predM[ "migrant" , "idclass" ] <- -2

#****
# CLASS LEVEL (Level 2)
# impute 'sprengel' and 'groesse' at the level of classes
impMethod[ "sprengel"] <- "2lonly.pmm2"
impMethod[ "groesse"] <- "2lonly.norm2"
predM[ c("sprengel","groesse") , "idclass" ] <- -2

# manifest group mean for Mscore
impMethod[ "M.Mscore" ] <- "2l.groupmean"
# latent group mean for Mscore
impMethod[ "LM.Mscore" ] <- "2l.latentgroupmean.ML"
predM[ "M.Mscore" , "Mscore" ] <- 2

# covariates for latent group mean of 'Mscore'
predM[ "LM.Mscore" , "Mscore" ] <- 2
predM[ "LM.Mscore" , c( "Dscore" , "sprengel" ) ] <- 1

# do imputations
imp <- mice::mice( dat , predictorMatrix = predM , m =3 ,  maxit = 4 ,
         imputationMethod = impMethod  , allow.na = TRUE , pan.iter=100)

## 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.