# [R-meta] Calculating conditional and marginal r-squared values for rma.mv models in metafor

Viechtbauer Wolfgang (SP) wolfgang.viechtbauer at maastrichtuniversity.nl
Wed Sep 27 23:31:30 CEST 2017

```(I've now tried multiple times to respond to this post via the mailing list, but for some reason my mails are not getting through; maybe the server is telling me to stop posting so much ... ok, one more try; this time I'll cut out the original message, just in case this is causing problems)

Dear Danielle,

First of all, I think you should use:

cover.hedges\$id <- 1:nrow(cover.hedges)
cover.rma <- rma.mv(yi, vi, random=~1|ACC/id, method="REML", data=cover.hedges)

See also: http://www.metafor-project.org/doku.php/analyses:konstantopoulos2011#a_common_mistake_in_the_three-level_model

I also don't understand what you mean by "We report the fsn for the model without coefficients, as well as the AICc for the top models with coefficients (within 2AICc units of the best model)." What do you mean by "fsn" here?

As for a pseudo-R^2, one can easily extend the way of computing R^2 for 'standard' mixed-effects meta-regression models to this type of model. That is, let 'res0' be the model without coefficients and 'res1' the model with (both fitted as shown above). Then:

(res0\$sigma2 - res1\$sigma2) / res0\$sigma2

gives the proportional reduction in each variance component, so R^2 for the study level and the estimate level. A 'total' R^2 would be:

(sum(res0\$sigma2) - sum(res1\$sigma2)) / sum(res0\$sigma2)

Best,
Wolfgang
```

More information about the R-sig-meta-analysis mailing list