getME | R Documentation |
Extract (or “get”) “components” – in a generalized
sense – from a fitted mixed-effects model, i.e. from an object
of class rlmerMod
or merMod
.
## S3 method for class 'rlmerMod'
getME(
object,
name = c("X", "Z", "Zt", "Ztlist", "mmList", "y", "mu", "u", "b.s", "b", "Gp", "Tp",
"Lambda", "Lambdat", "Tlist", "A", "U_b", "Lind", "sigma", "flist", "fixef", "beta",
"theta", "ST", "is_REML", "n_rtrms", "n_rfacs", "N", "n", "p", "q", "p_i", "l_i",
"q_i", "k", "m_i", "m", "cnms", "devcomp", "offset", "lower", "rho_e", "rho_b",
"rho_sigma_e", "rho_sigma_b", "M", "w_e", "w_b", "w_b_vector", "w_sigma_e",
"w_sigma_b", "w_sigma_b_vector"),
...
)
theta(object)
object |
a fitted mixed-effects model of class
|
name |
a character string specifying the name of the
“component”. Possible values are:
|
... |
potentially further arguments; not here. |
The function theta
is short for getME(, "theta")
.
The goal is to provide “everything a user may want” from a fitted
rlmerMod
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 rlmerMod objects, such as ranef
,
fixef
, vcov
, etc.:
see methods(class="rlmerMod")
## shows many methods you should consider *before* using getME():
methods(class = "rlmerMod")
## doFit = FALSE to speed up example
(fm1 <- rlmer(Reaction ~ Days + (Days|Subject), sleepstudy,
method="DASvar", doFit=FALSE))
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))
stopifnot(all.equal(theta(fm1), getME(fm1, "theta")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.