Skip to content
Prev 1494 / 5636 Next

[R-meta] variance explained by fixed & random effects

Yes, this is a good reference.

I will try to address a few of your questions.

1) What does it means if the pseudo R^2 statistic is negative?

R^2 type measures in meta-analysis are typically computed as proportional reductions in variance components (that reflect heterogeneity) when predictors/moderators are added to the model. However, for the models we typically use for a meta-analysis, there is no guarantee that the variance components always decrease (or remain unchanged) when we add predictors. So, it can happen that a variance component increases, in which case the R^2 value is technically negative. An example:

library(metafor)

dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)

res0 <- rma(yi, vi, data=dat)
res1 <- rma(yi, vi, mods = ~ alloc, data=dat)
res1

# proportional 'reduction' in tau^2 (how R^2 is computed here)
(res0$tau2 - res1$tau2) / res0$tau2

If you look at 'res1', R^2 is given as 0%, since negative R^2 values are simply set to 0.

So what does this mean? I would say it simply means that there is no reduction in the estimate of tau^2, so 'alloc' does not account for any heterogeneity.

But also keep in mind that the value of R^2 is an estimate that can be quite inaccurate esp. if the number of studies is small (https://onlinelibrary.wiley.com/doi/abs/10.1111/bmsp.12002). One may need maybe 30 or even more studies to get a fairly decent estimate (but don't quote me on that number).

Another important point here is that we compute R^2 based on how much *heterogeneity* is accounted for, not how much of the *total variance* is accounted for. So, for example:

res <- rma(yi, vi, mods = ~ ablat, data=dat)
res

This suggests that ~76% of the heterogeneity is accounted for by 'ablat' (but again, this estimate could be way off with k=13). But the total variance in this example is tau^2 plus the amount of sampling variability in the estimates (the 'vi' values). Since each study has a different amount of sampling variability, it isn't super clear how we then should think of the total variance, but one commonly used approach is to compute a 'typical' sampling variance and use that to define the total variance. For example, Higgins and Thompson (2002) suggest to compute the 'typical' sampling variance with:

k <- res$k
wi <- 1/dat$vi
vt <- (k-1) / (sum(wi) - sum(wi^2)/sum(wi)) 
vt

Others (https://academic.oup.com/aje/article/150/2/206/55325) have suggested using the harmonic mean, which would be:

1/mean(wi)

Regardless, we can then use tau^2 + vt as the total variance. 



2) How can we think of variance accounted for by random effects?

Another issue in this discussion is the question of how to think of 


-----Original Message-----
From: Theresa Stratmann [mailto:theresa.stratmann at senckenberg.de] 
Sent: Tuesday, 26 March, 2019 9:58
To: Viechtbauer, Wolfgang (SP); r-sig-meta-analysis at r-project.org
Subject: Re: [R-meta] variance explained by fixed & random effects

Hi all,

A paper from Nakagawa & Santos (2012) seems to answer my question (specifically the section "Heterogeneity - Quantifying Heterogeneity"). 

Nakagawa, S. & Santos, E.S.A. Evol Ecol (2012) 26: 1253. https://doi.org/10.1007/s10682-012-9555-5

Theresa