Learn R Programming

lme4 (version 0.999999-2)

mer-class: Mixed Model Representations and *mer Methods

Description

The mer class represents linear or generalized linear or nonlinear mixed-effects models. It incorporates sparse model matrices for the random effects and corresponding sparse Cholesky factors. The summary.mer class represents the summary of these objects.

Usage

## Methods with "surprising" arguments
## S3 method for class 'mer':
deviance(object, REML = NULL, \dots)
## S3 method for class 'mer':
expand(x, sparse = TRUE, \dots)
## S3 method for class 'mer':
logLik(object, REML = NULL, \dots)
## S3 method for class 'mer':
print(x, digits, correlation, symbolic.cor, signif.stars, \dots)

Arguments

object
object of class mer.
REML
logical indicating if REML should be used. A value of NULL, the default, or NA indicates that the REML values should be returned if the model was fit by REML, otherwise the ML values.
x
object of class mer to expand.
sparse
logical scalar indicating if the sparse form of the expanded T and S matrices should be returned.
digits
number of digits to use when printing tables of parameter estimates. Defaults to max(3, getOption("digits") - 3).
correlation
logical - should the correlation matrix of the fixed-effects parameter estimates be printed? Defaults to TRUE.
symbolic.cor
logical - should a symbolic form of the correlation matrix be printed instead of the numeric form? Defaults to FALSE.
signif.stars
logical - should the significance stars be printed as part of the table of fixed-effects parameter estimates? Defaults to getOption("show.signif.stars").
...
potential further arguments passed to methods.

Objects from the Class

Objects can be created by calls of the form new("mer", ...) or, more commonly, via the lmer, glmer or nlmer functions.

See Also

lmer(), glmer() and nlmer(), which produce these objects. VarCorr for extracting the variance and correlation components of the random-effects terms. mcmcsamp for posterior MCMC sampling of a mer fit; simulate-mer for simulation and parametric bootstrapping

Examples

Run this code
(fm2 <- lmer(Reaction ~ Days + (1|Subject) + (0+Days|Subject),
             data = sleepstudy))
print(fm2, digits = 10, corr = FALSE) # more precision; no corr.matrix

logLik(fm2)
(V2 <- vcov(fm2))
terms(fm2)
str(model.matrix(fm2))
str(model.frame(fm2))
str(resid(fm2))

VarCorr(fm2)
ee <- expand(fm2)
op <- options(digits = 3)
tcrossprod(ee$sigma * ee$P %*% ee$T %*% ee$S)
options(op)

Run the code above in your browser using DataLab