Stoffel Martin A, Nakagawa Shinichi, Schielzeth Holger
Institute of Ecology and Evolution, Friedrich-Schiller Universität Jena, Jena, Germany.
Institute of Evolutionary Biology, University of Edinburgh, Edinburgh, United Kingdom.
PeerJ. 2021 May 25;9:e11414. doi: 10.7717/peerj.11414. eCollection 2021.
The coefficient of determination quantifies the amount of variance explained by regression coefficients in a linear model. It can be seen as the fixed-effects complement to the repeatability (intra-class correlation) for the variance explained by random effects and thus as a tool for variance decomposition. The of a model can be further partitioned into the variance explained by a particular predictor or a combination of predictors using semi-partial (part) and structure coefficients, but this is rarely done due to a lack of software implementing these statistics. Here, we introduce partR2, an R package that quantifies part for fixed effect predictors based on (generalized) linear mixed-effect model fits. The package iteratively removes predictors of interest from the model and monitors the change in the variance of the linear predictor. The difference to the full model gives a measure of the amount of variance explained uniquely by a particular predictor or a set of predictors. partR2 also estimates structure coefficients as the correlation between a predictor and fitted values, which provide an estimate of the total contribution of a fixed effect to the overall prediction, independent of other predictors. Structure coefficients can be converted to the total variance explained by a predictor, here called 'inclusive' , as the square of the structure coefficients times total . Furthermore, the package reports beta weights (standardized regression coefficients). Finally, partR2 implements parametric bootstrapping to quantify confidence intervals for each estimate. We illustrate the use of partR2 with real example datasets for Gaussian and binomial GLMMs and discuss interactions, which pose a specific challenge for partitioning the explained variance among predictors.
决定系数量化了线性模型中回归系数所解释的方差量。它可以被视为对随机效应所解释方差的重复性(组内相关性)的固定效应补充,因此可作为方差分解的一种工具。模型的决定系数可以使用半偏(部分)决定系数和结构系数进一步划分为由特定预测变量或预测变量组合所解释的方差,但由于缺乏实现这些统计量的软件,这种做法很少见。在这里,我们介绍partR2,一个R包,它基于(广义)线性混合效应模型拟合来量化固定效应预测变量的部分决定系数。该包会迭代地从模型中移除感兴趣的预测变量,并监测线性预测变量方差的变化。与完整模型的差异给出了由特定预测变量或一组预测变量唯一解释的方差量的度量。partR2还将结构系数估计为预测变量与拟合值之间的相关性,它提供了固定效应对总体预测的总贡献的估计,独立于其他预测变量。结构系数可以转换为由预测变量解释的总方差,这里称为“包含性”决定系数,即结构系数的平方乘以总决定系数。此外,该包还报告β权重(标准化回归系数)。最后,partR2实现参数自助法来量化每个估计的置信区间。我们用高斯和二项式广义线性混合模型的实际示例数据集来说明partR2的使用,并讨论相互作用,这在预测变量之间划分解释方差时带来了特定的挑战。