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

View source: R/logLik.R

logLik.lmmR Documentation

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 class 'lmm'
logLik(object, data = NULL, p = NULL, indiv = FALSE, ...)

Arguments

object

a lmm object.

data

[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.

Value

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


LMMstar documentation built on Nov. 9, 2023, 1:06 a.m.