Learn R Programming

merDeriv (version 0.2-5)

estfun.glmerMod: Extract Cluster-wise Derivatives for Generalized Linear Mixed Effects Models

Description

A function for extracting the cluster-wise derivatives of a generalized linear mixed effects models fitted via lme4. This function returns the cluster-wise scores, evaluated at the ML estimates.

Usage

# S3 method for glmerMod
estfun(x, ...)

Value

A g by p score matrix, corresponding to

g clusters and p parameters. For models with multiple clustering variables (three-level models, crossed random effects), an error is thrown. If ranpar = "var", the random effects are parameterized as variance/covariance; If ranpar = "sd", the random effects are parameterized as standard deviation/correlation; If ranpar = "theta", the random effects are parameterized as components of Cholesky decomposition.

Arguments

x

An object of class glmerMod-class.

...

Additional arguments, including ranpar (ranpar = "var" is default; see details)

.

References

Douglas Bates, Martin Maechler, Ben Bolker, Steve Walker (2015). Fitting Linear Mixed-Effects Models Using lme4. Journal of Statistical Software, 67(1), 1-48. tools:::Rd_expr_doi("10.18637/jss.v067.i01").

Examples

Run this code
if (FALSE) {
data(finance, package = "smdata")

lme4fit <- glmer(corr ~ jmeth + (1 | item), data = finance,
                 family = binomial, nAGQ = 20)

# clusterwise scores
estfun(lme4fit, ranpar = "var")
}

Run the code above in your browser using DataLab