Skip to content
Prev 3950 / 5636 Next

[R-meta] H2 in the context of rma.mv

Dear Marlene,

It's not there, but you can calculate it manually. You can find a discussion on computing I^2 for more complex models here:

https://www.metafor-project.org/doku.php/tips:i2_multilevel_multivariate

Using the same principles discussed there, one can also compute H^2. And yes, your calculation below is doing just that. Using the notation in the page above, H^2 for the Konstantopoulos example would be:

W <- diag(1/res$vi)
X <- model.matrix(res)
P <- W - W %*% X %*% solve(t(X) %*% W %*% X) %*% t(X) %*% W
(sum(res$sigma2) + (res$k-res$p)/sum(diag(P))) / ((res$k-res$p)/sum(diag(P)))

Note that I put sum(res$sigma2) in the numerator instead of just res$sigma2[1]. I think for H^2, that is more sensible, since we are asking how much larger the *total variance* is compared to the amount of variance expected based on sampling variability alone. Just putting part of the variance components in the numerator leads to a rather convoluted interpretation of what the H^2 value represents.

Best,
Wolfgang