tips:i2_multilevel_multivariate
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
tips:i2_multilevel_multivariate [2021/01/06 10:58] – [General Equation for I^2] Wolfgang Viechtbauer | tips:i2_multilevel_multivariate [2022/03/18 09:48] – Wolfgang Viechtbauer | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== I^2 for Multilevel and Multivariate Models ===== | + | ===== $\boldsymbol{I^2}$ for Multilevel and Multivariate Models ===== |
The $I^2$ statistic was introduced by Higgins and Thompson in their seminal 2002 paper and has become a rather popular statistic to report in meta-analyses, | The $I^2$ statistic was introduced by Higgins and Thompson in their seminal 2002 paper and has become a rather popular statistic to report in meta-analyses, | ||
Line 26: | Line 26: | ||
<code rsplus> | <code rsplus> | ||
k <- res$k | k <- res$k | ||
- | wi <- 1/dat$vi | + | wi <- 1/res$vi |
vt <- (k-1) * sum(wi) / (sum(wi)^2 - sum(wi^2)) | vt <- (k-1) * sum(wi) / (sum(wi)^2 - sum(wi^2)) | ||
100 * res$tau2 / (res$tau2 + vt) | 100 * res$tau2 / (res$tau2 + vt) | ||
Line 34: | Line 34: | ||
</ | </ | ||
- | ==== General Equation for $\boldsymbol{I}^2$ ==== | + | ==== General Equation for $\boldsymbol{I^2}$ ==== |
Before we continue with more complex models, it is useful to point out a more general equation for computing $I^2,$ which also applies to models involving moderator variables (i.e., mixed-effects meta-regression models). This will also become important when dealing with models where sampling errors are no longer independent. So, let us define $$\mathbf{P} = \mathbf{W} - \mathbf{W} \mathbf{X} (\mathbf{X}' | Before we continue with more complex models, it is useful to point out a more general equation for computing $I^2,$ which also applies to models involving moderator variables (i.e., mixed-effects meta-regression models). This will also become important when dealing with models where sampling errors are no longer independent. So, let us define $$\mathbf{P} = \mathbf{W} - \mathbf{W} \mathbf{X} (\mathbf{X}' | ||
Line 40: | Line 40: | ||
Let's try this out for the example above: | Let's try this out for the example above: | ||
<code rsplus> | <code rsplus> | ||
- | W <- diag(1/dat$vi) | + | W <- diag(1/res$vi) |
X <- model.matrix(res) | X <- model.matrix(res) | ||
P <- W - W %*% X %*% solve(t(X) %*% W %*% X) %*% t(X) %*% W | P <- W - W %*% X %*% solve(t(X) %*% W %*% X) %*% t(X) %*% W | ||
Line 103: | Line 103: | ||
Based on the discussion above, it is now very easy to generalize the concept of $I^2$ to such a model (see also Nakagawa & Santos, 2012). That is, we can first compute: | Based on the discussion above, it is now very easy to generalize the concept of $I^2$ to such a model (see also Nakagawa & Santos, 2012). That is, we can first compute: | ||
<code rsplus> | <code rsplus> | ||
- | W <- diag(1/dat$vi) | + | W <- diag(1/res$vi) |
X <- model.matrix(res) | X <- model.matrix(res) | ||
P <- W - W %*% X %*% solve(t(X) %*% W %*% X) %*% t(X) %*% W | P <- W - W %*% X %*% solve(t(X) %*% W %*% X) %*% t(X) %*% W |
tips/i2_multilevel_multivariate.txt · Last modified: 2022/10/24 10:10 by Wolfgang Viechtbauer