"rma.uni"
, the function provides a full versus reduced model comparison in terms of model fit statistics and a likelihood ratio test. When a single model is specified, a Wald-type test of one or more model coefficients is carried out.## S3 method for class 'rma.uni':
anova(object, object2, btt, digits, \dots)
"rma.uni"
."rma.uni"
. See "anova.rma.uni"
. When a single model is specified, the object is a list containing the following components:NA
for fixed-effects models or if the amount of heterogeneity in the reduced model is equal to zero. This can be regarded as a pseudo print.anova.rma.uni
function.btt
argument. For example, with btt=c(3,4)
, only the third and fourth coefficient from the model would be included in the test (if an intercept is included in the model, then it corresponds to the first coefficient in the model).
When specifying two models for comparison, the function provides a likelihood ratio test comparing the two models. The models must be based on the same set of data and should be nested for the likelihood ratio test to make sense.rma.uni
, print.anova.rma.uni
### 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)
### 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 = ~ ablat + year, data=dat, method="ML")
### Wald-type test of the two moderators
anova(res1)
### corresponding likelihood ratio test
anova(res1, res2)
Run the code above in your browser using DataLab