Skip to content
Prev 263 / 5632 Next

[R-meta] Mixed effects meta-analysis model selection with glmulti

I would like to perform model selection on a meta-analysis model with mixed
effects, using rma.mv from metafor and the glmulti package. Code was
provided for doing this with fixed effects (
http://www.metafor-project.org/doku.php/tips:model_selection_with_glmulti)
but I can't figure out how to modify the code to work with multilevel
models.

I've tried

rma.glmulti <- function(formula, data, ...) {
  rma.mv(formula, vi, data=data, method="ML",random=random)
}

but it creates errors

I'm also not sure whether I would need to modify the second part of the
code

setOldClass("rma.mv")
setMethod('getfit', 'rma.mv', function(object, ...) {
  if (object$test=="z") {
    cbind(estimate=coef(object), se=sqrt(diag(vcov(object))), df=100000)
  } else {
    cbind(estimate=coef(object), se=sqrt(diag(vcov(object))),
df=object$k-object$p)
  }
})


Any help you can provide would be really appreciated!
Thank you
Bronwen