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

View source: R/estfun.glmerMod.R

estfun.glmerModR Documentation

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 class 'glmerMod'
estfun(x, ...)

Arguments

x

An object of class glmerMod.

...

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

.

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.

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. doi: 10.18637/jss.v067.i01.

Examples

## Not run: 
data(finance, package = "smdata")

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

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

## End(Not run)

nctingwang/merDeriv documentation built on Aug. 17, 2022, 3:06 p.m.