Learn R Programming

robustlmm (version 1.4-2)

getME: Extract or Get Generalize Components from a Fitted Mixed Effects Model

Description

Extract (or get) components -- in a generalized sense -- from a fitted mixed-effects model, i.e. from an object of class "rlmerMod" or "merMod".

The function theta is short for getME(, "theta").

Usage

getME(object,
        name = c("X", "Z", "Zt", "Ztlist", "y", "mu",
                 "u", "b.s", "b", "Gp", "Tp", "Lambda",
                 "Lambdat","A", "U_b", "Lind", "sigma",
                 "flist", "beta", "theta", "n_rtrms",
                 "n_rfacs", "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", "is_REML"))

theta(object)

Arguments

object
a fitted mixed-effects model of class "rlmerMod", i.e. typically the result of rlmer().
name
a character string specifying the name of the component. Possible values are: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Objec

Value

  • Unspecified, as very much depending on the name.

Details

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.

See Also

getCall(), More standard methods for rlmerMod objects, such as ranef, fixef, vcov, etc.: see methods(class="rlmerMod")

Examples

Run this code
## 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), getME(fm1, "beta"),
		    check.attributes=FALSE, tolerance = 0))

## All that can be accessed [potentially ..]:
(nmME <- eval(formals(getME)$name))
## internal consistency check ensuring that all work:
## "try(.)" because some are not yet implemented:
str(parts <- sapply(nmME, function(nm) try(getME(fm1, nm)),
                    simplify=FALSE))% dont..
stopifnot(all.equal(theta(fm1), getME(fm1, "theta")))

Run the code above in your browser using DataLab