logLik.LMMsolve: Log-likelihood of an LMMsolve object

View source: R/LMMsolve-class.R

logLik.LMMsolveR Documentation

Log-likelihood of an LMMsolve object

Description

Obtain the Restricted Maximum Log-Likelihood of a model fitted using LMMsolve.

Usage

## S3 method for class 'LMMsolve'
logLik(object, includeConstant = TRUE, ...)

Arguments

object

an object of class LMMsolve

includeConstant

Should the constant in the restricted log-likelihood be included. Default is TRUE, as for example in lme4 and SAS. In asreml the constant is omitted.

...

some methods for this generic require additional arguments. None are used in this method.

Value

The restricted maximum log-likelihood of the fitted model.

Examples

## Fit model on john.alpha data from agridat package.
data(john.alpha, package = "agridat")

## Fit simple model with only fixed effects.
LMM1 <- LMMsolve(fixed = yield ~ rep + gen,
                data = john.alpha)

## Obtain log-likelihood.
logLik(LMM1)

## Obtain log-likelihood without constant.
logLik(LMM1, includeConstant = FALSE)


LMMsolver documentation built on Sept. 11, 2024, 7:31 p.m.