nlme (version 3.1-18)

logLik.lm: Extract Log-Likelihood from an lm Object

Description

If REML=FALSE, returns the log-likelihood value of the linear model represented by object evaluated at the estimated coefficients; else, the restricted log-likelihood evaluated at the estimated coefficients is returned.

Usage

logLik(object, REML)

Arguments

Value

the (restricted) log-likelihood of the linear model represented by object evaluated at the estimated coefficients.

References

Harville, D.A. (1974) "Bayesian Inference for Variance Components Using Only Error Contrasts", Biometrika, 61, 383-385.

See Also

lm

Examples

Run this code
data(Orthodont)
fm1 <- lm(distance ~ Sex * age, Orthodont)
logLik(fm1)
logLik(fm1, REML = TRUE)

Run the code above in your browser using DataLab