Skip to content
Prev 12381 / 20628 Next

Post model fitting checks in Metafor (rma.mv)

By default (check options("contrasts")), R should use treatment contrasts (see help(contr.treatment)). So, one level of each factor is chosen as the reference level and you get coefficients that indicate the contrasts with this reference level. So, if you use 'mods = ~ Age + Treatment + Biomarker' and Age has 3 levels, Treatment has 5 levels, and Biomarker has 3 levels, then you should get 2+4+2=8 coefficients. So:

predict(res, newmods=c(1,0, 0,0,0,0, 0,0))

would give you the predicted effect for the second level of Age, reference level for Treatment, and reference level for Biomarker. And

predict(res, newmods=c(0,1, 0,0,1,0, 1,0))

would be for the third level of Age, fourth level of Treatment, and second level of Biomarker. And so on ...

You may also want to take a look at this tutorial:

http://www.metafor-project.org/doku.php/tips:testing_factors_lincoms

It doesn't cover multiple factors (I'll add one to the website soon), but should help to clarify things a bit. Also, some things won't work for 'rma.mv' models at this point (e.g., the anova() function or permutation tests). But you can use predict(), linearHypothesis() from the 'car' package, and glht() from the 'multcomp' package.

Best,
Wolfgang