[R-meta] Multivariate meta regression and predict for robust estimates

Ivan Jukic |v@n@juk|c @end|ng |rom @ut@@c@nz
Fri Oct 22 04:47:03 CEST 2021


Dear Wolfgang,

thank you for chiming in and providing a great solution!

I was thinking about a way of "connecting" the clubSandwich and robust from metafor, but couldn't make it work. This is fantastic, thank you!

Cheers,
Ivan

----
From: Viechtbauer, Wolfgang (SP) <wolfgang.viechtbauer using maastrichtuniversity.nl>
Sent: Friday, 22 October 2021 1:46 AM
To: Ivan Jukic <ivan.jukic using aut.ac.nz>; Reza Norouzian <rnorouzian using gmail.com>
Cc: r-sig-meta-analysis using r-project.org <r-sig-meta-analysis using r-project.org>
Subject: RE: [R-meta] Multivariate meta regression and predict for robust estimates 
 
Going to jump in here with respect to question B)

I don't think (James -- please correct me if I overlooked something) that there is something like predict() in clubSandwich. However, one could be a bit sneaky and put the clubSandwich results into a metafor object and then proceed with predict(). An example:

dat <- dat.bornmann2007
dat <- escalc(measure="OR", ai=waward, n1i=wtotal, ci=maward, n2i=mtotal, data=dat)
res <- rma.mv(yi, vi, mods = ~ type, random = ~ 1 | study/obs, data=dat)
res

sav <- robust(res, cluster=dat$study)
sav

# corresponding clubSandwich results
tmp1 <- coef_test(res, vcov="CR2", cluster=dat$study)
tmp2 <- conf_int(res, vcov="CR2", cluster=dat$study)
tmp3 <- Wald_test(res, constraints=constrain_zero(res$btt), vcov="CR2", cluster=dat$study)
tmp1
tmp2
tmp3

# force those results into 'sav'
sav$b     <- sav$beta <- tmp1$beta
sav$se    <- tmp1$SE
sav$zval  <- tmp1$tstat
sav$ddf   <- tmp1$df
sav$pval  <- tmp1$p_Satt
sav$ci.lb <- tmp2$CI_L
sav$ci.ub <- tmp2$CI_U
sav$vb    <- vcovCR(res, cluster=dat$study, type="CR2")
sav$QM    <- tmp3$Fstat
sav$QMdf  <- c(tmp3$df_num, round(tmp3$df_denom,2))
sav$QMp   <- tmp3$p_val
sav

# now proceed with predict()
predict(res, newmods=0:1, transf=exp)

Best,
Wolfgang


More information about the R-sig-meta-analysis mailing list