Learn R Programming

metafor (version 0.5-0)

logLik.rma: Log-Likelihood of rma Objects

Description

The function extracts the (restricted) log likelihood for objects of class "rma".

Usage

## S3 method for class 'rma':
logLik(object, REML=NULL, ...)

Arguments

object
an object of class "rma".
REML
logical indicating whether the regular or restricted log likelihood should be returned. When NULL (default), the regular log likelihood is returned, unless restricted maximum likelihood estimation was used to fit the model.
...
other arguments.

Value

  • The (restricted) log likelihood of the model evaluated at the estimated coefficient(s).

See Also

fitstats.rma, rma.uni, rma.mh, rma.peto

Examples

Run this code
### load BCG vaccine data
data(dat.bcg)

### meta-analysis of the log risk rates using a mixed-effects model
### with two moderators (absolute latitude and publication year)
res <- rma(ai=tpos, bi=tneg, ci=cpos, di=cneg, mods=cbind(ablat, year),
           data=dat.bcg, measure="RR", method="REML")
logLik(res)

Run the code above in your browser using DataLab