\HeaderA{logLik.lme}{Log-Likelihood of an lme Object}{logLik.lme}
\aliasA{logLik.gls}{logLik.lme}{logLik.gls}
\keyword{models}{logLik.lme}
\begin{Description}\relax
If \code{REML=FALSE}, returns the log-likelihood value of the linear
mixed-effects model represented by \code{object} evaluated at the
estimated  coefficients; else, the restricted log-likelihood evaluated
at the estimated coefficients is returned.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'lme':
logLik(object, REML, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] an object inheriting from class \code{lme}, representing
a fitted linear mixed-effects model.
\item[\code{REML}] an optional logical value. If \code{TRUE} the restricted
log-likelihood is returned, else, if \code{FALSE}, the log-likelihood
is returned. Defaults to \code{FALSE}. 
\item[\code{...}] some methods for this generic require additional
arguments.  None are used in this method.
\end{ldescription}
\end{Arguments}
\begin{Value}
the (restricted) log-likelihood of the model represented by
\code{object} evaluated at the estimated coefficients.
\end{Value}
\begin{Author}\relax
Jose Pinheiro and Douglas Bates
\end{Author}
\begin{References}\relax
Harville, D.A. (1974) ``Bayesian Inference for Variance Components
Using Only Error Contrasts'', \emph{Biometrika}, \bold{61}, 383--385.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{lme}{lme}},\code{\LinkA{gls}{gls}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
fm1 <- lme(distance ~ Sex * age, Orthodont, random = ~ age, method = "ML")
logLik(fm1)
logLik(fm1, REML = TRUE)
\end{ExampleCode}
\end{Examples}

