The metafor Package

A Meta-Analysis Package for R

User Tools

Site Tools


tips:comp_two_independent_estimates

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
tips:comp_two_independent_estimates [2024/03/28 09:00] Wolfgang Viechtbauertips:comp_two_independent_estimates [2024/04/18 10:49] Wolfgang Viechtbauer
Line 43: Line 43:
  
 <code rsplus> <code rsplus>
-dat.comp <- data.frame(meta     = c("random", "other"), +dat.comp <- data.frame(alloc    = c("random", "other"), 
                        estimate = c(coef(res1), coef(res2)),                         estimate = c(coef(res1), coef(res2)), 
                        stderror = c(res1$se, res2$se),                        stderror = c(res1$se, res2$se),
Line 51: Line 51:
  
 <code output> <code output>
-    meta estimate stderror  tau2+   alloc estimate stderror  tau2
 1 random   -0.971    0.276 0.393 1 random   -0.971    0.276 0.393
 2  other   -0.481    0.217 0.212 2  other   -0.481    0.217 0.212
Line 59: Line 59:
  
 <code rsplus> <code rsplus>
-rma(estimate, sei=stderror, mods = ~ meta, method="FE", data=dat.comp, digits=3)+rma(estimate, sei=stderror, mods = ~ alloc, method="FE", data=dat.comp, digits=3)
 </code> </code>
  
Line 73: Line 73:
 Model Results: Model Results:
  
-            estimate     se    zval   pval   ci.lb   ci.ub +             estimate     se    zval   pval   ci.lb   ci.ub 
-intrcpt       -0.481  0.217  -2.218  0.027  -0.907  -0.056 +intrcpt        -0.481  0.217  -2.218  0.027  -0.907  -0.056 
-metarandom    -0.490  0.351  -1.395  0.163  -1.178   0.198+allocrandom    -0.490  0.351  -1.395  0.163  -1.178   0.198
  
 --- ---
Line 138: Line 138:
  
 <code rsplus> <code rsplus>
-rma.mv(yi, vi, mods = ~ alloc, random = ~ alloc | trial, struct="DIAG", data=dat, digits=3)+rma.mv(yi, vi, mods = ~ alloc, random = ~ alloc | trial,  
 +       struct="DIAG", data=dat, digits=3)
 </code> </code>
  
tips/comp_two_independent_estimates.txt · Last modified: 2024/04/18 11:36 by Wolfgang Viechtbauer