### 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
res1 <- rma(yi, vi, data=dat, method="ML")
### mixed-effects model with two moderators (absolute latitude and publication year)
res2 <- rma(yi, vi, mods = ~ ablat + year, data=dat, method="ML")
### Wald-type test of the two moderators
anova(res2)
### alternative way of specifying the same test
anova(res2, L=rbind(c(0,1,0), c(0,0,1)))
### corresponding likelihood ratio test
anova(res1, res2)
### test of a linear combination
anova(res2, L=c(1,35,1970))
Run the code above in your browser using DataLab