Learn R Programming

lme4 (version 0.99875-9)

lmer-class: Mixed Model Representations and *mer Methods

Description

The mer class is mixed-effects representation using a sparse, symmetric, column-oriented matrix and several dense matrices. The lmer class extends mer to represent a fitted linear mixed-effects model. The summary.mer and summary.lmer classes represent summaries of these objects. The coef.lmer and ranef.lmer classes represent fixed and random effect coefficients.

Usage

## S3 method for class 'mer':
logLik(object, REML = object@status["REML"], \dots)
## S3 method for class 'mer':
vcov(object, REML = object@status["REML"], \dots)

Arguments

object
object of class mer or lmer.
REML
logical indicating if REML should be used.
...
potential further arguments passed to methods.

Objects from the Class

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

See Also

lmer() produces these objects. VarCorr for extracting the variance and correlation components of the random-effects terms.

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))
str(resid(fm2))

## Simulate 'Reaction' according to the fitted model:
dim(ss <- simulate(fm2, nsim = 200, seed = 101)) ## -> 180 x 200

Run the code above in your browser using DataLab