File: mice.impute.2l.norm.Rd

package info (click to toggle)
r-cran-mice 3.17.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,380 kB
  • sloc: cpp: 121; sh: 25; makefile: 2
file content (82 lines) | stat: -rw-r--r-- 3,056 bytes parent folder | download | duplicates (2)
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
79
80
81
82
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mice.impute.2l.norm.R
\name{mice.impute.2l.norm}
\alias{mice.impute.2l.norm}
\title{Imputation by a two-level normal model}
\usage{
mice.impute.2l.norm(y, ry, x, type, wy = NULL, intercept = TRUE, ...)
}
\arguments{
\item{y}{Vector to be imputed}

\item{ry}{Logical vector of length \code{length(y)} indicating the
the subset \code{y[ry]} of elements in \code{y} to which the imputation
model is fitted. The \code{ry} generally distinguishes the observed
(\code{TRUE}) and missing values (\code{FALSE}) in \code{y}.}

\item{x}{Numeric design matrix with \code{length(y)} rows with predictors for
\code{y}. Matrix \code{x} may have no missing values.}

\item{type}{Vector of length \code{ncol(x)} identifying random and class
variables.  Random variables are identified by a '2'. The class variable
(only one is allowed) is coded as '-2'. Random variables also include the
fixed effect.}

\item{wy}{Logical vector of length \code{length(y)}. A \code{TRUE} value
indicates locations in \code{y} for which imputations are created.}

\item{intercept}{Logical determining whether the intercept is automatically
added.}

\item{...}{Other named arguments.}
}
\value{
Vector with imputed data, same type as \code{y}, and of length
\code{sum(wy)}
}
\description{
Imputes univariate missing data using a two-level normal model
}
\details{
Implements the Gibbs sampler for the linear multilevel model with
heterogeneous with-class variance (Kasim and Raudenbush, 1998). Imputations
are drawn as an extra step to the algorithm. For simulation work see Van
Buuren (2011).

The random intercept is automatically added in \code{mice.impute.2L.norm()}.
A model within a random intercept can be specified by \code{mice(...,
intercept = FALSE)}.
}
\note{
Added June 25, 2012: The currently implemented algorithm does not
handle predictors that are specified as fixed effects (type=1). When using
\code{mice.impute.2l.norm()}, the current advice is to specify all predictors
as random effects (type=2).

Warning: The assumption of heterogeneous variances requires that in every
class at least one observation has a response in \code{y}.
}
\references{
Kasim RM, Raudenbush SW. (1998). Application of Gibbs sampling to nested
variance components models with heterogeneous within-group variance. Journal
of Educational and Behavioral Statistics, 23(2), 93--116.

Van Buuren, S., Groothuis-Oudshoorn, K. (2011). \code{mice}: Multivariate
Imputation by Chained Equations in \code{R}. \emph{Journal of Statistical
Software}, \bold{45}(3), 1-67. \doi{10.18637/jss.v045.i03}

Van Buuren, S. (2011) Multiple imputation of multilevel data. In Hox, J.J.
and and Roberts, J.K. (Eds.), \emph{The Handbook of Advanced Multilevel
Analysis}, Chapter 10, pp. 173--196. Milton Park, UK: Routledge.
}
\seealso{
Other univariate-2l: 
\code{\link{mice.impute.2l.bin}()},
\code{\link{mice.impute.2l.lmer}()},
\code{\link{mice.impute.2l.pan}()}
}
\author{
Roel de Jong, 2008
}
\concept{univariate-2l}
\keyword{datagen}