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) 

REQUIRED ARGUMENTS:

object
an object inheriting from class lm.

OPTIONAL ARGUMENTS:

REML
an optional logical value. If TRUE the restricted log-likelihood is returned, else, if FALSE, the log-likelihood is returned. Defaults to FALSE.

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:

EXAMPLES:

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