The metafor Package

A Meta-Analysis Package for R

User Tools

Site Tools


faq

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
faq [2022/08/30 11:18] Wolfgang Viechtbauerfaq [2022/09/25 11:23] Wolfgang Viechtbauer
Line 73: Line 73:
 ??? For mixed-effects models, how is the $R^2$ statistic computed by the rma() function? ??? For mixed-effects models, how is the $R^2$ statistic computed by the rma() function?
  
-!!! The pseudo $R^2$ statistic (Raudenbush, 2009) is computed with $$R^2 = \frac{\hat{\tau}_{RE}^2 - \hat{\tau}_{ME}^2}{\hat{\tau}_{RE}^2},$$ where $\hat{\tau}_{RE}^2$ denotes the estimated value of $\tau^2$ based on the random-effects model (i.e., the total amount of heterogeneity) and $\hat{\tau}_{ME}^2$ denotes the estimated value of $\tau^2$ based on the mixed-effects model (i.e., the residual amount of heterogeneity). It can happen that $\hat{\tau}_{RE}^2 < \hat{\tau}_{ME}^2$, in which case $R^2$ is set to zero. Again, the value of $R^2$ will change depending on the estimator of $\tau^2$ used. Also note that this statistic is only computed when the mixed-effects model includes an intercept (so that the random-effects model is clearly nested within the mixed-effects model). You can also use the ''[[https://wviechtb.github.io/metafor/reference/anova.rma.html|anova()]]'' function to compute $R^2$ for any two models that are known to be nested.+!!! The pseudo $R^2$ statistic (Raudenbush, 2009) is computed with $$R^2 = \frac{\hat{\tau}_{RE}^2 - \hat{\tau}_{ME}^2}{\hat{\tau}_{RE}^2} = 1 - \frac{\hat{\tau}_{ME}^2}{\hat{\tau}_{RE}^2},$$ where $\hat{\tau}_{RE}^2$ denotes the estimated value of $\tau^2$ based on the random-effects model (i.e., the total amount of heterogeneity) and $\hat{\tau}_{ME}^2$ denotes the estimated value of $\tau^2$ based on the mixed-effects model (i.e., the residual amount of heterogeneity). It can happen that $\hat{\tau}_{RE}^2 < \hat{\tau}_{ME}^2$, in which case $R^2$ is set to zero. Again, the value of $R^2$ will change depending on the estimator of $\tau^2$ used. Also note that this statistic is only computed when the mixed-effects model includes an intercept (so that the random-effects model is clearly nested within the mixed-effects model). You can also use the ''[[https://wviechtb.github.io/metafor/reference/anova.rma.html|anova()]]'' function to compute $R^2$ for any two models that are known to be nested.
  
 ??? For random-effects models fitted with the rma() function, how is the prediction interval computed by the predict() function? ??? For random-effects models fitted with the rma() function, how is the prediction interval computed by the predict() function?
faq.txt · Last modified: 2023/01/24 07:56 by Wolfgang Viechtbauer