Skip to content

[R-meta] Separate tau for each subgroup in mixed-effect models

4 messages · Wolfgang Viechtbauer, Arthurcsirio, Arthur Albuquerque

#
This has also been possible with the rma.mv() function:

https://www.metafor-project.org/doku.php/tips:comp_two_independent_estimates#meta-regression_with_all_studies_but_different_amounts_of_residual_heterogeneity

So, actually, there are three different ways one can do this:

1) Fit separate RE models within subgroups.

dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)

res1 <- list(rma(yi, vi, data=dat, subset=alloc=="alternate"),
             rma(yi, vi, data=dat, subset=alloc=="random"),
             rma(yi, vi, data=dat, subset=alloc=="systematic"))

dat.comp <- data.frame(meta     = c("alternate","random","systematic"), 
                       estimate = sapply(res1, coef),
                       stderror = sqrt(sapply(res1, vcov)),
                       tau2     = sapply(res1, \(x) x$tau2))
dat.comp <- dfround(dat.comp, 4)
dat.comp

2) Fit an rma.mv() model with a random effects structure that allows tau^2 to differ across groups.

res2 <- rma.mv(yi, vi, mods = ~ 0 + alloc, random = ~ alloc | trial, struct="DIAG", data=dat)
res2

3) Use a location-scale model with a categorical scale variable.

res3 <- rma(yi, vi, mods = ~ 0 + alloc, scale = ~ 0 + alloc, data=dat)
res3
predict(res3, newscale=diag(3), transf=exp)

Instead of using the (default) log link, we can also use an identity link to fit this model:

res4 <- rma(yi, vi, mods = ~ 0 + alloc, scale = ~ 0 + alloc, data=dat, link="identity")
res4

Compare the log likelihoods:

sum(sapply(res1, logLik)) # add up the three log likelihoods
logLik(res2)
logLik(res3)
logLik(res4)

The results match up nicely, as they should.[1] This is in fact a nice confirmation that the underlying code - which is rather different for these different approaches - works as intended.

[1] You might actually see minor discrepancies here and there. They can arise due to differences in how these models are fitted and the optimization routines used.

Best,
Wolfgang
#
This is great.
  

  
Thanks, Wolfgang.
  
  
  
 Arthur Albuquerque

  
  
#
Wolfgang,

I now realized this discussion is related to the discussion presented in this book:?https://bookdown.org/MathiasHarrer/Doing_Meta_Analysis_in_R/subgroup.html

To my understanding, they argue - while citing?Borenstein & Higgins 2013 - that the models you discussed treat subgroups as ?fixed-effects?, but also?assume studies within subgroups follow the random-effects model (see their Figure 7.1).

Thus, I conclude these model impose a conditional inference to the subgroups analyzed.

What do you think?

Best,

Arthur M. Albuquerque

Borenstein, Michael, and Julian P. T. Higgins. ?Meta-Analysis and Subgroups?. Prevention Science 14, no. 2 (April 2013): 134?43.?https://doi.org/10.1007/s11121-013-0377-7
On Sep 1, 2022, 5:18 AM -0300, Viechtbauer, Wolfgang (NP) <wolfgang.viechtbauer at maastrichtuniversity.nl>, wrote:

  
  
4 days later
#
Hi Arthur,

If you fit a random-effects model per subgroup (or use a single model that accomplishes the exact same thing), it's an unconditional inference as far as I am concerned.

Best,
Wolfgang