[R-meta] Equivalence of two models in metafor
Zhouhan Jin
zj|n65 @end|ng |rom uwo@c@
Tue Apr 2 17:46:59 CEST 2024
Dear Wolfgang,
Below, moderator X is coded "no" whenever moderator Y is coded "b" or "c", and moderator X is coded "yes" whenever moderator Y is coded "d".
Thus, I expected that a contrast like "no - yes" (`con1`) to be identical to a contrast like "b + c - d" (`con2`).
However, I wonder why `con1` and `con2` aren't identical?
dat <- read.table(header=TRUE, text="
study X Y yi vi
1 no b 1 .1
1 no b 2 .2
1 no c .9 .1
2 no c .7 .3
2 yes d .6 .1
3 yes d .5 .1")
f1 <- rma(yi~X+0, vi, data = dat)
f2 <- rma(yi~Y+0, vi, data = dat)
A = emmprep(f1)
B = emmprep(f2)
( con1 = contrast(A, list(c(1,-1))) )
( con2 = contrast(B, list(c(1,1,-1))) )
Thanks in advance!
Best wishes,
Zhouhan
[[alternative HTML version deleted]]
More information about the R-sig-meta-analysis
mailing list