| getME | R Documentation |
Extract (or “get”) “components” – in a
generalized sense – from a fitted mixed-effects model,
i.e., (in this version of the package) from an object of
class "merMod".
getME(object, name, ...)
## S3 method for class 'merMod'
getME(object,
name = c("X", "Z", "Zt", "Ztlist", "mmList", "y", "mu", "u", "b",
"Gp", "Tp", "L", "Lambda", "Lambdat", "Lind", "Tlist",
"A", "RX", "RZX", "sigma", "flist",
"fixef", "beta", "theta", "ST", "REML", "is_REML",
"n_rtrms", "n_rfacs", "N", "n", "p", "q",
"p_i", "l_i", "q_i", "k", "m_i", "m",
"cnms", "devcomp", "offset", "lower", "devfun", "glmer.nb.theta"),
...)
object |
a fitted mixed-effects model of class
|
name |
a character vector specifying the name(s) of
the “component”. If
|
... |
currently unused in lme4, potentially further arguments in methods. |
The goal is to provide “everything a user may
want” from a fitted "merMod" object as far
as it is not available by methods, such as
fixef, ranef,
vcov, etc.
Unspecified, as very much depending on the name.
getCall(). More standard methods for "merMod"
objects, such as ranef, fixef,
vcov, etc.: see methods(class="merMod")
## shows many methods you should consider *before* using getME():
methods(class = "merMod")
(fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy))
Z <- getME(fm1, "Z")
stopifnot(is(Z, "CsparseMatrix"),
c(180,36) == dim(Z),
all.equal(fixef(fm1), b1 <- getME(fm1, "beta"),
check.attributes=FALSE, tolerance = 0))
## A way to get *all* getME()s :
## internal consistency check ensuring that all work:
parts <- getME(fm1, "ALL")
str(parts, max=2)
stopifnot(identical(Z, parts $ Z),
identical(b1, parts $ beta))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.