The metafor Package

A Meta-Analysis Package for R

User Tools

Site Tools


analyses:berkey1998

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
analyses:berkey1998 [2022/08/03 11:17] Wolfgang Viechtbaueranalyses:berkey1998 [2022/08/03 16:52] Wolfgang Viechtbauer
Line 52: Line 52:
 A multivariate random-effects model can now be used to meta-analyze the two outcomes simultaneously. A multivariate random-effects model can now be used to meta-analyze the two outcomes simultaneously.
 <code rsplus> <code rsplus>
-res <- rma.mv(yi, V, mods = ~ outcome - 1, random = ~ outcome | trial, struct="UN", data=dat, method="ML")+res <- rma.mv(yi, V, mods = ~ outcome - 1, 
 +              random = ~ outcome | trial, struct="UN", 
 +              data=dat, method="ML")
 print(res, digits=3) print(res, digits=3)
 </code> </code>
Line 94: Line 96:
 The results given in Table II in the paper actually are based on a meta-regression model, using year of publication as a potential moderator. To replicate those analyses, we use: The results given in Table II in the paper actually are based on a meta-regression model, using year of publication as a potential moderator. To replicate those analyses, we use:
 <code rsplus> <code rsplus>
-res <- rma.mv(yi, V, mods = ~ outcome + outcome:I(year - 1983) - 1, random = ~ outcome | trial, struct="UN", data=dat, method="ML")+res <- rma.mv(yi, V, mods = ~ outcome + outcome:I(year - 1983) - 1, 
 +              random = ~ outcome | trial, struct="UN", 
 +              data=dat, method="ML")
 print(res, digits=3) print(res, digits=3)
 </code> </code>
Line 140: Line 144:
 To test whether the slope of publication year actually differs for the two outcomes, we can fit the same model with: To test whether the slope of publication year actually differs for the two outcomes, we can fit the same model with:
 <code rsplus> <code rsplus>
-res <- rma.mv(yi, V, mods = ~ outcome*I(year - 1983) - 1, random = ~ outcome | trial, struct="UN", data=dat, method="ML")+res <- rma.mv(yi, V, mods = ~ outcome*I(year - 1983) - 1, 
 +              random = ~ outcome | trial, struct="UN", 
 +              data=dat, method="ML")
 print(res, digits=3) print(res, digits=3)
 </code> </code>
Line 162: Line 168:
 One could actually consider a simpler model for these data, which assumes a compound symmetry structure for the random effects (this would imply that the amount of heterogeneity is the same for the two outcomes). A formal comparison of the two models can be conducted using a likelihood ratio test: One could actually consider a simpler model for these data, which assumes a compound symmetry structure for the random effects (this would imply that the amount of heterogeneity is the same for the two outcomes). A formal comparison of the two models can be conducted using a likelihood ratio test:
 <code rsplus> <code rsplus>
-res1 <- rma.mv(yi, V, mods = ~ outcome - 1, random = ~ outcome | trial, struct="UN", data=dat, method="ML"+res1 <- rma.mv(yi, V, mods = ~ outcome - 1, 
-res0 <- rma.mv(yi, V, mods = ~ outcome - 1, random = ~ outcome | trial, struct="CS", data=dat, method="ML")+               random = ~ outcome | trial, struct="UN", 
 +               data=dat, method="ML"
 +res0 <- rma.mv(yi, V, mods = ~ outcome - 1, 
 +               random = ~ outcome | trial, struct="CS", 
 +               data=dat, method="ML")
 anova(res0, res1) anova(res0, res1)
 </code> </code>
analyses/berkey1998.txt · Last modified: 2023/06/22 11:42 by Wolfgang Viechtbauer