anova.rma.uni {metafor} | R Documentation |
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.
## S3 method for class 'rma.uni': anova(object, object2, digits=object$digits, ...)
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. |
The two models must be based on the same set of data and should be nested for the likelihood ratio test to make sense.
An object of class "anova.rma.uni"
. The object is a list containing the following components:
fit.stats.f |
log likelihood, deviance, AIC, and BIC for the full model. |
fit.stats.r |
log likelihood, deviance, AIC, and BIC for the reduced model. |
p.f |
number of parameters in the full model. |
p.r |
number of parameters in the reduced model. |
LRT |
likelihood ratio test statistic. |
pval |
p-value for the likelihood ratio test. |
QE.f |
test statistic for the test of (residual) heterogeneity from the full model. |
QE.r |
test statistic for the test of (residual) heterogeneity from the reduced model. |
tau2.f |
tau2 value from the full model. |
tau2.r |
tau2 value from the reduced model. |
VAF |
amount 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.
Note that likelihood ratio tests are not meaningful when using REML estimation and the two models have different fixed effects.
In principle, one can also consider likelihood ratio tests for (residual) heterogeneity in random- and mixed-effects models. The full model should then be fitted with either method="ML"
or method="REML"
and the reduced model with method="FE"
. The p-value from that test is based on a chi-square distribution with 1 degree of freedom, but actually needs to be adjusted for the fact that the parameter (i.e., tau^2) falls on the boundary of the parameter space under the null hypothesis. Moreover, the Q-test usually keeps better control of the Type I error rate and therefore should be preferred (see Viechtbauer, 2007, for more details).
Wolfgang Viechtbauer; wvb@www.wvbauer.com; http://www.wvbauer.com/
Viechtbauer, W. (2007) Hypothesis tests for population heterogeneity in meta-analysis. British Journal of Mathematical and Statistical Psychology, 60, 29–60.
### load BCG vaccine data data(dat.bcg) ### calculate log risk ratios and corresponding sampling variances dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg) dat <- cbind(dat.bcg, dat) ### random-effects model res2 <- rma(yi, vi, data=dat, method="REML") ### mixed-effects model with two moderators (absolute latitude and publication year) res1 <- rma(yi, vi, mods=cbind(ablat, year), data=dat, method="REML") anova(res1, res2)