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.
翻译:元分析模型通常被表述为一种混合效应模型,其中效应量的抽样方差被视为已知。原则上,此类模型可以使用标准的混合建模软件(如glmmTMB R包)进行拟合。这个用于广义线性混合模型(GLMMs)的通用包通过模板模型构建器(TMB)在分布和随机效应协方差结构方面提供了灵活性。然而,在glmmTMB中,之前难以轻松地将已知的抽样方差纳入传统的元分析逆方差公式中。在此,我们引入了glmmTMB中的一种新协方差结构——equalto,该结构允许用户在拟合元分析模型时提供已知的抽样误差方差-协方差矩阵。这使得能够显式地建模抽样误差间的异方差性和依赖性。这一新实现为拟合元分析模型提供了一种替代方法,方便已熟悉glmmTMB的用户使用。通过模拟,我们证明该新实现产生的模型估计值与已有metafor包的结果一致,并以医学、进化生态学和社会科学领域已发表的元分析为例说明了其适用性。此外,glmmTMB中的这一创新实现支持对元分析数据进行更灵活的建模,扩展了可用于证据综合的R工具包。