Skip to content
Prev 4880 / 5636 Next

[R-meta] Checking for Multi-Collinearity with continuous and categorial predictors

Dear Wilma,

In general, always provide a fully reproducible example to illustrate a problem. For example, like this:

library(metafor)
library(car)

dat <- dat.bangertdrowns2004
res <- rma(yi, vi, mods = ~ length + wic + feedback + info + pers + imag + meta, data=dat)
vif(res)

So the problem arises because you are loading the 'car' package *after* you have loaded metafor and it also has a vif() function. The vif() function from metafor is then 'masked', so calling vif() calls car::vif() and not metafor::vif(). But you can always explicitly tell R which vif() function to call, like this:

metafor::vif(res)

Best,
Wolfgang