The metafor Package

A Meta-Analysis Package for R

User Tools

Site Tools


analyses:vanhouwelingen2002

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
analyses:vanhouwelingen2002 [2022/08/03 11:23] Wolfgang Viechtbaueranalyses:vanhouwelingen2002 [2022/08/03 17:52] (current) Wolfgang Viechtbauer
Line 170: Line 170:
 <code rsplus> <code rsplus>
 res <- rma(measure="OR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat, method="ML") res <- rma(measure="OR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat, method="ML")
-labbe(res, xlim=c(-7,-1), ylim=c(-7,-1), xlab="ln(odds) not-vaccinated group", ylab="ln(odds) vaccinated group")+labbe(res, xlim=c(-7,-1), ylim=c(-7,-1), 
 +      xlab="ln(odds) not-vaccinated group", ylab="ln(odds) vaccinated group")
 </code> </code>
 The dashed line indicates the estimated effect based on the model. The dashed line indicates the estimated effect based on the model.
Line 219: Line 220:
 Since there is no overlap in the data used to calculate these arm-specific outcomes, the observed outcomes are (conditionally) independent. However, the corresponding true outcomes are likely to be correlated. The bivariate model allows us to estimate the variance and correlation of the true outcomes in the two arms: Since there is no overlap in the data used to calculate these arm-specific outcomes, the observed outcomes are (conditionally) independent. However, the corresponding true outcomes are likely to be correlated. The bivariate model allows us to estimate the variance and correlation of the true outcomes in the two arms:
 <code rsplus> <code rsplus>
-res <- rma.mv(yi, vi, mods = ~ group - 1, random = ~ group | trial, struct="UN", data=dat.long, method="ML")+res <- rma.mv(yi, vi, mods = ~ group - 1, 
 +              random = ~ group | trial, struct="UN", 
 +              data=dat.long, method="ML")
 res res
 </code> </code>
Line 257: Line 260:
 We can directly obtain the estimated (mean) log odds ratio from this model by not removing the intercept: We can directly obtain the estimated (mean) log odds ratio from this model by not removing the intercept:
 <code rsplus> <code rsplus>
-res <- rma.mv(yi, vi, mods = ~ group, random = ~ group | trial, struct="UN", data=dat.long, method="ML")+res <- rma.mv(yi, vi, mods = ~ group, 
 +              random = ~ group | trial, struct="UN", 
 +              data=dat.long, method="ML")
 </code> </code>
 The last part of the output is then: The last part of the output is then:
Line 281: Line 286:
  
 <code rsplus> <code rsplus>
-res <- rma.mv(yi, vi, mods = ~ group - 1, random = ~ group | trial, struct="UN", data=dat.long, method="ML")+res <- rma.mv(yi, vi, mods = ~ group - 1, 
 +              random = ~ group | trial, struct="UN", 
 +              data=dat.long, method="ML")
 reg <- matreg(y=2, x=1, R=res$G, cov=TRUE, means=coef(res), n=res$g.levels.comb.k) reg <- matreg(y=2, x=1, R=res$G, cov=TRUE, means=coef(res), n=res$g.levels.comb.k)
 reg reg
Line 297: Line 304:
 <code rsplus> <code rsplus>
 tmp <- rma(measure="OR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat, method="EE") tmp <- rma(measure="OR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat, method="EE")
-labbe(tmp, xlim=c(-8,0), ylim=c(-8,0), xlab="ln(odds) not-vaccinated group", ylab="ln(odds) vaccinated group", lty=c("dotted", "blank"), grid=TRUE)+labbe(tmp, xlim=c(-8,0), ylim=c(-8,0), 
 +      xlab="ln(odds) not-vaccinated group", ylab="ln(odds) vaccinated group", 
 +      lty=c("dotted", "blank"), grid=TRUE)
 points(coef(res)[1], coef(res)[2], pch=19, cex=3) points(coef(res)[1], coef(res)[2], pch=19, cex=3)
 abline(a=reg$tab$beta[1], b=reg$tab$beta[2], lwd=3) abline(a=reg$tab$beta[1], b=reg$tab$beta[2], lwd=3)
Line 322: Line 331:
  
 <code rsplus> <code rsplus>
-res <- rma.mv(yi, vi, mods = ~ group - 1, random = ~ group | trial, struct="UN", data=dat.long, method="ML", cvvc="varcov", control=list(nearpd=TRUE))+res <- rma.mv(yi, vi, mods = ~ group - 1, 
 +              random = ~ group | trial, struct="UN", 
 +              data=dat.long, method="ML", cvvc="varcov", control=list(nearpd=TRUE))
 </code> </code>
  
Line 393: Line 404:
 The bivariate meta-regression model can be fitted with: The bivariate meta-regression model can be fitted with:
 <code rsplus> <code rsplus>
-res <- rma.mv(yi, vi, mods = ~ group + group:I(ablat-33) - 1, random = ~ group | trial, struct="UN", data=dat.long, method="ML")+res <- rma.mv(yi, vi, mods = ~ group + group:I(ablat-33) - 1, 
 +              random = ~ group | trial, struct="UN", 
 +              data=dat.long, method="ML")
 res res
 </code> </code>
Line 433: Line 446:
 The difference in slopes can be directly obtained with: The difference in slopes can be directly obtained with:
 <code rsplus> <code rsplus>
-res <- rma.mv(yi, vi, mods = ~ group*I(ablat-33), random = ~ group | trial, struct="UN", data=dat.long, method="ML")+res <- rma.mv(yi, vi, mods = ~ group*I(ablat-33), 
 +              random = ~ group | trial, struct="UN", 
 +              data=dat.long, method="ML")
 </code> </code>
 The results are the same as before, except for the last part, which is now equal to: The results are the same as before, except for the last part, which is now equal to:
analyses/vanhouwelingen2002.txt · Last modified: 2022/08/03 17:52 by Wolfgang Viechtbauer