Learn R Programming

metafor (version 1.4-0)

anova.rma.uni: Compare Fit Statistics and Likelihoods of rma.uni Objects

Description

The function provides a full versus reduced model comparison of two objects of class "rma.uni". Model fit statistics for the two models are provided. A likelihood ratio test comparing the two models is also performed.

Usage

## S3 method for class 'rma.uni':
anova(object, object2, digits=object$digits, \dots)

Arguments

object
an object of class "rma.uni".
object2
an object of class "rma.uni".
digits
an integer specifying the number of decimal places to which the printed results should be rounded (the default is to take the value from the object).
...
other arguments.

Value

  • An object of class "anova.rma.uni". The object is a list containing the following components:
  • fit.stats.flog likelihood, deviance, AIC, and BIC for the full model.
  • fit.stats.rlog likelihood, deviance, AIC, and BIC for the reduced model.
  • p.fnumber of parameters in the full model.
  • p.rnumber of parameters in the reduced model.
  • LRTlikelihood ratio test statistic.
  • pvalp-value for the likelihood ratio test.
  • QE.ftest statistic for the test of (residual) heterogeneity from the full model.
  • QE.rtest statistic for the test of (residual) heterogeneity from the reduced model.
  • tau2.ftau2 value from the full model.
  • tau2.rtau2 value from the reduced model.
  • VAFamount of (residual) heterogeneity in the reduced model that is accounted for in the full model. NA for fixed-effects models or if the amount of heterogeneity in the reduced model is equal to zero.
  • The results are formated and printed with the print.anova.rma.uni function.

Details

The two models must be based on the same set of data and should be nested for the likelihood ratio test to make sense.

References

Viechtbauer, W. (2007). Hypothesis tests for population heterogeneity in meta-analysis. British Journal of Mathematical and Statistical Psychology, 60, 29--60. 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, print.anova.rma.uni

Examples

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

### calculate log relative risks and corresponding sampling variances
dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, 
              data=dat.bcg, append=TRUE)

### random-effects model 
res2 <- rma(yi, vi, data=dat, method="ML")

### mixed-effects model with two moderators (absolute latitude and publication year)
res1 <- rma(yi, vi, mods=cbind(ablat, year), data=dat, method="ML")

anova(res1, res2)

Run the code above in your browser using DataLab