[R-meta] Equivalence of two models in metafor
Zhouhan Jin
zj|n65 @end|ng |rom uwo@c@
Mon Apr 8 23:58:05 CEST 2024
Thanks so much, Wolfgang!
It seems that the inferential results (SEs, test statistics, and p-values) are still different between `con1` and `con2`.
The contrast for the model with more categories (`con2`) produces smaller values for these inferential results compared to that from the contrast for the model with less categories (`con1`).
Can I conclude that in a situation like this, f2 model (and thus `con2`) subsumes/nests/includes f1 model (and thus `con1`), and hence the latter is redundant?
Thanks a lot!
Best wishes,
Zhouhan
On Apr 8, 2024 at 16:37 -0400, Viechtbauer, Wolfgang (NP) <wolfgang.viechtbauer using maastrichtuniversity.nl>, wrote:
Dear Zhouhan,
If you want to compare these two contrasts, you should use:
( con1 = contrast(A, list(c(1,-1))) )
( con2 = contrast(B, list(c(1/2,1/2,-1))) )
You will find they are similar, but still not identical. There are two reasons for this. First, the estimates of tau^2 are different in the two models. This leads to different weighting schemes. But even if we use a fixed-effects meta-regression model with:
f1 <- rma(yi~X+0, vi, data = dat, method="FE")
f2 <- rma(yi~Y+0, vi, data = dat, method="FE")
you will find that the contrasts are still different. That's because one has to use an appropriately weighted average of the estimates of Yb and Yc to get the same contrast:
w <- diag(solve(vcov(f2)))[1:2]
w <- w / sum(w)
( con2 = contrast(B, list(c(w,-1))) )
This is now the same as:
( con1 = contrast(A, list(c(1,-1))) )
Best,
Wolfgang
-----Original Message-----
From: R-sig-meta-analysis <r-sig-meta-analysis-bounces using r-project.org> On Behalf
Of Zhouhan Jin via R-sig-meta-analysis
Sent: Tuesday, April 2, 2024 17:47
To: r-sig-meta-analysis using r-project.org
Cc: Zhouhan Jin <zjin65 using uwo.ca>
Subject: [R-meta] Equivalence of two models in metafor
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