Learn R Programming

LMMstar (version 1.1.0)

logLik.lmm: Extract The Log-Likelihood From a Linear Mixed Model

Description

Extract or compute the log-likelihood of a linear mixed model.

Usage

# S3 method for lmm
logLik(object, newdata = NULL, p = NULL, indiv = FALSE, ...)

Value

A numeric value (total logLikelihood) or a vector of numeric values, one for each cluster (cluster specific logLikelihood).

Arguments

object

a lmm object.

newdata

[data.frame] dataset relative to which the log-likelihood should be computed. Only relevant if differs from the dataset used to fit the model.

p

[numeric vector] value of the model coefficients at which to evaluate the log-likelihood. Only relevant if differs from the fitted values.

indiv

[logical] Should the contribution of each cluster to the log-likelihood be output? Otherwise output the sum of all clusters of the derivatives.

...

Not used. For compatibility with the generic method.

Details

indiv: only relevant when using maximum likelihood. Must be FALSE when using restricted maximum likelihood.