🤖 AI Summary
This study addresses a key limitation of the glmmTMB package, which traditionally cannot incorporate known sampling variances of effect sizes in meta-analysis, thereby restricting its utility in evidence synthesis. We introduce, for the first time, the equalto covariance structure within glmmTMB, enabling users to specify known sampling error variance–covariance matrices and explicitly model heteroscedasticity and dependencies among sampling errors. Implemented in R using the glmmTMB and Template Model Builder (TMB) framework, this approach allows direct fitting of generalized linear mixed models with known sampling variances. Simulation studies confirm that parameter estimates align exactly with those from the widely used metafor package. The method has been successfully applied to real-world meta-analyses across medicine, evolutionary ecology, and social sciences, substantially expanding the applicability of glmmTMB in meta-analytic research.
📝 Abstract
Meta-analytical models are typically formulated as a mixed-effects model where the sampling variances of the effect sizes are treated as known. In principle, such models could be fitted with standard mixed-modelling software such as the glmmTMB R package. This general-purpose package for generalized linear mixed models (GLMMs) provides flexibility in distributions and random effect covariance structures through the Template Model Builder (TMB). However, incorporating known sampling variances in the conventional inverse-variance formulation of meta-analysis was previously not easily accomplished in glmmTMB. Here, we introduce equalto, a new covariance structure in glmmTMB that allows users to supply a known sampling error variance-covariance matrix when fitting meta-analytic models. This enables explicit modelling of heteroscedasticity and dependence among sampling errors. The new implementation provides an alternative way to fit meta-analytic models, convenient for users already familiar with glmmTMB. Using simulations, we show that the new implementation produces model estimates identical to those from the established metafor package and illustrate its applicability with published meta-analyses in medicine, evolutionary ecology, and the social sciences. Further, this novel implementation in glmmTMB supports more flexible modelling of meta-analytical data, expanding the R toolkit available for evidence synthesis.