Skip to content
Prev 3095 / 5632 Next

[R-meta] Difference between "GEN" and "UN" in metafor

Dear Fred,

See my responses below.

Best,
Wolfgang
This is likely no longer going to be a requirement in the next version of metafor, that is, variable 'outcome' will automatically be treated as a factor.
Correct. || and interactions are also possible.
The former does something slightly non-standard in that it adds correlated random effects for each outcome level within study, that is, it is really doing:

random = ~  outcome - 1 | study, struct="GEN"

The latter uses standard formula syntax, so it will add a random intercept for studies and a random slope for the outcome level that is not the reference level (and allows the intercept and slope to be correlated).

The fit of these two specifications is the same, but the interpretation of the variances components and correlation differs.
Same as in lme(), lmer(), and other packages for multilevel/mixed-effects modelling.

In other words: struct="UN" is really just a special case where (a) one can only specify a single categorical variable on the left of | and (b) the formula gets automatically changed to 'factor(inner) - 1 | outer'. The rest is just completely standard syntax / random-effects modelling.

I added struct="UN" (and some of the simpler structures such as "HCS" and "CS") because they are quite commonly used in the usual 'advanced' meta-analytic models (e.g., as used in a 'standard' multivariate or multilevel model or in network meta-analysis). But you can do everything with struct="GEN" (and more) that struct="UN" gives you - although you cannot adopt a simplified var-cov structure when you use struct="GEN" (like "HCS" or "CS"), except if you use ||, which then is like struct="DIAG".