Skip to content

[R-meta] I2 and R2 estimation

1 message · Lukasz Stasielowicz

#
Hi,

For I2, there is a vignette on the official metafor page: 
https://www.metafor-project.org/doku.php/tips:i2_multilevel_multivariate


For R2, you need the model with the moderator (res1) and the model 
without moderators (e.g., res).

If you want to estimate R2 separately for different levels, then you can 
use the tau2 values (sigma2) from the respective levels, e.g.,
(res$sigma2[1] - res1$sigma2[1]) / res$sigma2[1]
(res$sigma2[2] - res1$sigma2[2]) / res$sigma2[2]
If you prefer to estimate only one R2 value, then the following code 
will suffice:
(sum(res$sigma2) - sum(res1$sigma2)) / sum(res$sigma2)



Best wishes,