Skip to contents

Calculate the log likelihood of a multivariate linear model.

Usage

<!-- % logLik.manylm -->
# S3 method for manylm
logLik(object, REML = FALSE, ...)

Arguments

object

a manylm object from which a log-likelihood value should be extracted.

...

some methods for this function require additional 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.

Details

It is assumed that the scale has been estimated (by maximum likelihood or REML), and all the constants in the log-likelihood are included.

Value

Returns an object, say r, of class logLik which is a number with attributes, attr(r, "df") (degrees of

freedom) giving the number of (estimated) parameters in the model.

Examples

data(spider)
spiddat <- mvabund(spider$abund)
lm.spider <- manylm(spiddat~., data=spider$x)
logLik(lm.spider)
#> 'log Lik.'  -82.23117,  -90.82730,  -72.20628,  -59.43927,  -62.45190,  -89.03656,  -98.13404, -120.14104, -121.73527, -117.76401, -118.10046,  -88.70699 (df=8)