A mixed-effects model is represented as a
'>merPredD object and a response
module of a class that inherits from class
'>lmResp. A model with a
'>lmerResp response has class
'>glmResp response has class
glmerMod; and a
'>nlsResp response has class
# S3 method for merMod anova(object, ..., refit = TRUE, model.names=NULL) # S3 method for merMod as.function(x, ...) # S3 method for merMod coef(object, ...) # S3 method for merMod deviance(object, REML = NULL, ...) REMLcrit(object) # S3 method for merMod extractAIC(fit, scale = 0, k = 2, ...) # S3 method for merMod family(object, ...) # S3 method for merMod formula(x, fixed.only = FALSE, random.only = FALSE, ...) # S3 method for merMod fitted(object, ...) # S3 method for merMod logLik(object, REML = NULL, ...) # S3 method for merMod nobs(object, ...) # S3 method for merMod ngrps(object, ...) # S3 method for merMod terms(x, fixed.only = TRUE, random.only = FALSE, …) # S3 method for merMod vcov(object, correlation = TRUE, sigm = sigma(object), use.hessian = NULL, …) # S3 method for merMod model.frame(formula, fixed.only = FALSE, ...) # S3 method for merMod model.matrix(object, type = c("fixed", "random", "randomListRaw"), ...) # S3 method for merMod print(x, digits = max(3, getOption("digits") - 3), correlation = NULL, symbolic.cor = FALSE, signif.stars = getOption("show.signif.stars"), ranef.comp = "Std.Dev.", ...)
# S3 method for merMod summary(object, correlation = , use.hessian = NULL, …) # S3 method for summary.merMod print(x, digits = max(3, getOption("digits") - 3), correlation = NULL, symbolic.cor = FALSE, signif.stars = getOption("show.signif.stars"), ranef.comp = c("Variance", "Std.Dev."), show.resids = TRUE, ...) # S3 method for merMod update(object, formula., ..., evaluate = TRUE) # S3 method for merMod weights(object, type = c("prior", "working"), ...)
an R object of class
respectively, the latter resulting from
logical indicating if objects of class
lmerMod should be
refitted with ML before comparing models. The default is
TRUE to prevent the common mistake of inappropriately
comparing REML-fitted models with different fixed effects,
whose likelihoods are not directly comparable.
character vectors of model names to be used in the anova table.
Not currently used (see
TRUE, return the restricted log-likelihood
rather than the log-likelihood. If
NULL (the default),
logical indicating if only the fixed effects components (terms or formula elements) are sought. If false, all components, including random ones, are returned.
whether random components only are sought. (Trying to specify
random.only at the same time
will produce an error.)
vcov, indicates whether the correlation matrix as well as
the variance-covariance matrix is desired;
summary.merMod, indicates whether the correlation matrix
should be computed and stored along with the covariance;
print.summary.merMod, indicates whether the correlation
matrix of the fixed-effects parameters should be printed. In the
latter case, when
NULL (the default), the correlation matrix
is printed when it has been computed by
summary(.), and when
\(p <= 20\).
(logical) indicates whether to use the
finite-difference Hessian of the deviance function to compute
standard errors of the fixed effects, rather estimating
based on internal information about the inverse of
the model matrix (see
The default is to to use the Hessian whenever the
fixed effect parameters are arguments to the deviance
function (i.e. for GLMMs with
nAGQ>0), and to use
getME(.,"RX") whenever the fixed effect parameters are
profiled out (i.e. for GLMMs with
nAGQ==0 or LMMs).
use.hessian=FALSE is backward-compatible with older versions
lme4, but may give less accurate SE estimates when the
estimates of the fixed-effect (see
and random-effect (see
the residual standard error; by default
number of significant digits for printing
should a symbolic encoding of the fixed-effects correlation
matrix be printed? If so, the
symnum function is used.
(logical) should significance stars be used?
character vector of length one or two, indicating if random-effects parameters should be reported on the variance and/or standard deviation scale.
should the quantiles of the scaled residuals be printed?
type of weights to be returned; either
the initially supplied weights or
"working" for the weights
at the final iteration of the penalized iteratively reweighted least
squares algorithm (PIRLS).
type of model matrix to
return: one of
"fixed" giving the fixed effects model matrix,
"random" giving the random effects model matrix, or
"randomListRaw" giving a list of the raw random effects model
matrices associated with each random effects term.
potentially further arguments passed from other methods.
The following S3 methods with arguments given above exist (this list is currently not complete):
returns the sequential decomposition of the contributions of
fixed-effects terms or, for multiple arguments, model comparison statistics.
For objects of class
lmerMod the default behavior is to refit the models
with ML if fitted with
REML = TRUE, this can be controlled via the
refit argument. See also
Computes the sum of the random and fixed effects coefficients for each explanatory variable for each level of each grouping factor.
Computes the (generalized) Akaike An
Information Criterion. If
refitted using maximum likelihood.
family of fitted
GLMM. (Warning: this accessor may not work properly with
customized families/link functions.)
Fitted values, given the conditional modes of
the random effects. For more flexible access to fitted values, use
Log-likelihood at the fitted value of the
parameters. Note that for GLMMs, the returned value is only
proportional to the log probability density (or distribution) of the
response variable. See
returns the fixed effects model matrix.
Number of observations and vector of
the numbers of levels in each grouping factor. See
Computes and returns a list of summary statistics of the
fitted model, the amount of output can be controlled via the
Controls the output for the summary method.
Calculate variance-covariance matrix of the fixed
effect terms, see also
One must be careful when defining the deviance of a GLM. For example, should the deviance be defined as minus twice the log-likelihood or does it involve subtracting the deviance for a saturated model? To distinguish these two possibilities we refer to absolute deviance (minus twice the log-likelihood) and relative deviance (relative to a saturated model, e.g. Section 2.3.1 in McCullagh and Nelder 1989).
With GLMMs however, there is an additional complication involving the
distinction between the likelihood and the conditional likelihood.
The latter is the likelihood obtained by conditioning on the estimates
of the conditional modes of the spherical random effects coefficients,
whereas the likelihood itself (i.e. the unconditional likelihood)
involves integrating out these coefficients. The following table
summarizes how to extract the various types of deviance for a
|| NA in
This table requires two caveats:
If the link function involves a scale parameter
object@resp$aic() - 2 * getME(object,
"devcomp")$dims["useSc"] is required for the absolute-conditional
If adaptive Gauss-Hermite quadrature is used, then
logLik(object) is currently only proportional to the
For more information about this topic see the
directory in the package source.
A reference class object for an lme4
response module (
The matched call.
The model frame containing all of the variables required to parse the model formula.
Covariance parameter vector.
Fixed effects coefficients.
Conditional model of spherical random effects coefficients.
A reference class object for an lme4
predictor module (
List containing information about the nonlinear optimization.
Other methods for
merMod objects documented elsewhere include: