Abstract

The coefficient of determination R2 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 R (intra-class correlation) for the variance explained by random effects and thus as a tool for variance decomposition. The R2 of a model can be further partitioned into the variance explained by a particular predictor or a combination of predictors using semi-partial (part) R2 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 R2 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’ R2, as the square of the structure coefficients times total R2. 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.

Highlights

  • Coefficients of determination R2 are of interest in the study of ecology and evolution, because they quantify the amount of variation explained by a linear model (Edwards et al, 2008)

  • R2 is expressed as a proportion of the total variance in the response, which represents a biologically relevant quantity if the total variation is representative for the total population (De Villemereuil et al, 2018)

  • Where y is a vector of response values, X is the design matrix of fixed effects, β is a vector of regression coefficients, αk is the random part of the model that might contain multiple random effects and ε is a vector of residual deviations

Read more

Summary

INTRODUCTION

Coefficients of determination R2 are of interest in the study of ecology and evolution, because they quantify the amount of variation explained by a linear model (Edwards et al, 2008). Semi-partial coefficients of determination, known as part R2, decompose the variance of R2 into components uniquely explained by individual predictors (Jaeger et al, 2017; Jaeger, Edwards & Gurka, 2019) or sets of predictors (Fig. 1). Structure coefficients range from −1 to 1 with their absolute value expressing the correlation relative to a perfect correlation if a single predictor explains as much as the total fixed part of the model. The Landesamt fuÌĹr Natur, Umwelt und Verbraucherschutz Nordrhein-Westfalen "LANUV NRW" (Germany) approved this research (reference number: 84-02.04.2015.A439)

A Gaussian mixed-effects model can be written as:
Code and data availability

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.