Learn R Programming

metafor (version 1.9-4)

fitstats: Fit Statistics and Information Criteria for 'rma' Objects

Description

Functions to extract the log-likelihood, deviance, AIC, BIC, and AICc values from objects of class "rma".

Usage

fitstats(object, ...)

## S3 method for class 'rma':
fitstats(object, REML, \dots)

## S3 method for class 'rma':
logLik(object, REML, \dots)
## S3 method for class 'rma':
deviance(object, REML, \dots)

## S3 method for class 'rma':
AIC(object, \dots, k=2, correct=FALSE)
## S3 method for class 'rma':
BIC(object, \dots)

Arguments

object
an object of class "rma".
REML
logical indicating whether the regular or restricted likelihood function should be used to obtain the fit statistics and information criteria. Defaults to the method of estimation used, that is TRUE if object was fitted with
k
numeric value specifying the penalty per parameter to be used. The default (k=2) is the classical AIC. See AIC for more details.
correct
logical indicating whether the regular (default) or corrected (i.e., AICc) should be extracted.
...
other arguments.

Value

  • For fitstats.rma, a column vector with the (restricted) log-likelihood, deviance, AIC, BIC, and AICc values. For logLik.rma, an object of class "logLik", providing the (restricted) log-likelihood of the model evaluated at the estimated coefficient(s). For deviance.rma, a numeric value with the corresponding deviance. For AIC.rma, a numeric value with the corresponding AIC or AICc. For BIC.rma, a numeric value with the corresponding BIC.

References

Viechtbauer, W. (2010). Conducting meta-analyses in R with the metafor package. Journal of Statistical Software, 36(3), 1--48. http://www.jstatsoft.org/v36/i03/.

See Also

rma.uni, rma.mh, rma.peto, rma.glmm, rma.mv, anova.rma.uni

Examples

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

### meta-analysis of the log relative risks using a random-effects model
res1 <- rma(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg,
            data=dat.bcg, method="ML")

### mixed-effects model with two moderators (latitude and publication year)
res2 <- rma(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, mods = ~ ablat + year,
            data=dat.bcg, method="ML")

fitstats(res1)
fitstats(res2)

logLik(res1)
logLik(res2)

deviance(res1)
deviance(res2)

AIC(res1)
AIC(res2)

AIC(res1, correct=TRUE)
AIC(res2, correct=TRUE)

BIC(res1)
BIC(res2)

Run the code above in your browser using DataLab