Skip to content
Prev 2295 / 5636 Next

[R-meta] Moderation analysis in IPD meta-analysis

Dear Corentin,

Overall, your approach seems sound. But a few notes:

1) study1<-glm(DV~IV, data=datastudy1) is not logistic regression. You need:

study1 <- glm(DV ~ IV, data=datastudy1, family=binomial)

2) I've only played around with emmeans a little bit, so can't comment on that part. But I don't think you even need it. You can just fit the model in such a way that you directly get the three log odds ratios for the three levels of IV. In fact, the estimates of the three log odds ratios are independent, so one could even just fit three simple logistic regression models that will give you the same results. An example:

dat <- data.frame(DV = c(1,0,0,1,0,1,1,1,0,1,1,1),
                  IV = c(1,3,2,3,5,3,7,7,4,9,6,3),
                  VM = rep(c("a","b","c"),each=4))

# parameterize logistic regression model so we get the three log odds ratios directly
res <- glm(DV ~ VM + IV:VM - 1, data=dat, family=binomial)
summary(res)

# the covariance between the three estimates is 0
round(vcov(res), 5)

# show that the simple logistic regression model for a subset gives the same results
res.a <- glm(DV ~ IV, data=dat, family=binomial, subset=VM=="a")
summary(res.a)

So actually the V matrix corresponding to the three log odds ratios is diagonal. But you still would want to account for potential dependency in the underlying true log odds ratios, so the model

model <- rma.mv(yi, V, mods = ~ VM-1, random=~VM|study, struct="UN", data=dat)

is still appropriate (with V being diagonal, so you can also just pass a vector with the sampling variances to rma.mv).

3) The statement that 2-stage approaches cannot be used to analyze patient-level moderators isn't quite true. If one actually analyzes the patient-level moderator in stage 1 (as you describe), then the 2-stage approach definitely allows you to examine such a patient-level moderator.

Best,
Wolfgang