tips:weights_in_rma.mv_models
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:weights_in_rma.mv_models [2021/04/16 07:46] – Wolfgang Viechtbauer | tips:weights_in_rma.mv_models [2021/11/08 15:16] – Wolfgang Viechtbauer | ||
---|---|---|---|
Line 11: | Line 11: | ||
dat <- dat.bcg | dat <- dat.bcg | ||
dat <- escalc(measure=" | dat <- escalc(measure=" | ||
- | slab=paste0(dat$author, ", ", | + | slab=paste0(author, |
dat | dat | ||
</ | </ | ||
Line 36: | Line 36: | ||
<code rsplus> | <code rsplus> | ||
- | res.fe <- rma(yi, vi, data=dat, method=" | + | res.ee <- rma(yi, vi, data=dat, method=" |
res.re <- rma(yi, vi, data=dat) | res.re <- rma(yi, vi, data=dat) | ||
</ | </ | ||
Line 43: | Line 43: | ||
<code rsplus> | <code rsplus> | ||
- | w.fe.re <- cbind( | + | w.ee.re <- cbind( |
- | paste0(formatC(weights(res.fe), format=" | + | paste0(formatC(weights(res.ee), format=" |
paste0(formatC(weights(res.re), | paste0(formatC(weights(res.re), | ||
</ | </ | ||
Line 52: | Line 52: | ||
<code rsplus> | <code rsplus> | ||
forest(dat$yi, | forest(dat$yi, | ||
- | | + | |
abline(h=0) | abline(h=0) | ||
- | addpoly(res.fe, row=-1, atransf=exp) | + | addpoly(res.ee, row=-1, atransf=exp) |
addpoly(res.re, | addpoly(res.re, | ||
- | text(-6, 15, "FE Model", | + | text(-6, 15, "EE Model", |
text(-4, 15, "RE Model", | text(-4, 15, "RE Model", | ||
text(-5, 16, " | text(-5, 16, " | ||
Line 68: | Line 68: | ||
In the RE model, the estimates are weighted with $w_i = 1 / (\hat{\tau}^2 + v_i)$. Therefore, not only the sampling variance, but also the (estimated) amount of heterogeneity (i.e., the variance in the underlying true effects) is taken into consideration when determining the weights. When $\hat{\tau}^2$ is large (relative to the size of the sampling variances), then the weights actually become quite similar to each other. Hence, smaller (less precise) studies may receive almost as much as weight as larger (more precise) studies. We can in fact see this happening in the present example. While the three studies mentioned above still receive the largest weights, their weights are now much more similar to those of the other studies. As a result, the summary estimate is not as strongly pulled to the right by the TPT Madras study. | In the RE model, the estimates are weighted with $w_i = 1 / (\hat{\tau}^2 + v_i)$. Therefore, not only the sampling variance, but also the (estimated) amount of heterogeneity (i.e., the variance in the underlying true effects) is taken into consideration when determining the weights. When $\hat{\tau}^2$ is large (relative to the size of the sampling variances), then the weights actually become quite similar to each other. Hence, smaller (less precise) studies may receive almost as much as weight as larger (more precise) studies. We can in fact see this happening in the present example. While the three studies mentioned above still receive the largest weights, their weights are now much more similar to those of the other studies. As a result, the summary estimate is not as strongly pulled to the right by the TPT Madras study. | ||
- | The weights used in fixed- and random-effects models are the inverse of the model-implied variances of the observed outcomes. For example, in the RE model, the model considers two sources of variability that affect the observed outcomes: sampling variability ($v_i$) and heterogeneity ($\hat{\tau}^2$). The sum of these two sources of variability is $\hat{\tau}^2 + v_i$ and the weights are therefore $w_i = 1 / (\hat{\tau}^2 + v_i)$. The summary estimate is then simply the weighted average of the estimates, namely $$\hat{\mu} = \frac{\sum_{i=1}^k w_i y_i}{\sum_{i=1}^k w_i}.$$ By comparing | + | The weights used in equal- and random-effects models are the inverse of the model-implied variances of the observed outcomes. For example, in the RE model, the model considers two sources of variability that affect the observed outcomes: sampling variability ($v_i$) and heterogeneity ($\hat{\tau}^2$). The sum of these two sources of variability is $\hat{\tau}^2 + v_i$ and the weights are therefore $w_i = 1 / (\hat{\tau}^2 + v_i)$. The summary estimate is then simply the weighted average of the estimates, namely $$\hat{\mu} = \frac{\sum_{i=1}^k w_i y_i}{\sum_{i=1}^k w_i}.$$ By comparing |
<code rsplus> | <code rsplus> | ||
Line 271: | Line 271: | ||
<code rsplus> | <code rsplus> | ||
data.frame(k = c(table(dat$district)), | data.frame(k = c(table(dat$district)), | ||
- | | + | |
</ | </ | ||
<code output> | <code output> | ||
Line 294: | Line 294: | ||
==== Conclusions ==== | ==== Conclusions ==== | ||
- | The example above shows that the weighting scheme underlying more complex models (that can be fitted with the '' | + | The example above shows that the weighting scheme underlying more complex models (that can be fitted with the '' |
**Note:** James Pustejovsky has written up a very nice [[https:// | **Note:** James Pustejovsky has written up a very nice [[https:// |
tips/weights_in_rma.mv_models.txt · Last modified: 2023/08/03 13:37 by Wolfgang Viechtbauer