Learn R Programming

metafor (version 1.3-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, \dots)

Arguments

object
an object of class "rma".
REML
an optional logical value. If TRUE, the restricted log-likelihood is returned, else, if FALSE, the log-likelihood is returned. Defaults to the method of estimation used, that is TRUE if object was fitted
...
other arguments.

Value

  • An object of class "logLik". The object provides 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 relative risks 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