partR2: partitioning R2 in generalized linear mixed models

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 and monitors the change in R2 as 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 are converted to the total variance explained by a predictor, termed ‘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 binomials GLMMs and discuss interactions, which pose a specific challenge for partitioning the explained variance among predictors.

[1]  S. H. Richter,et al.  Individuality meets plasticity: Endocrine phenotypes across male dominance rank acquisition in guinea pigs living in a complex social environment , 2021, Hormones and Behavior.

[2]  Jason D Rights,et al.  New Recommendations on the Use of R-Squared Differences in Multilevel Model Comparisons , 2020, Multivariate behavioral research.

[3]  H. Piepho A coefficient of determination (R2) for generalized linear mixed models , 2019, Biometrical journal. Biometrische Zeitschrift.

[4]  Byron C. Jaeger,et al.  An R2 statistic for covariance model selection in the linear mixed model , 2019 .

[5]  Anthony R. Ives,et al.  rr2: An R package to calculate R2s for regression models , 2018, J. Open Source Softw..

[6]  H. Schielzeth,et al.  Spatial analyses of two color polymorphisms in an alpine grasshopper reveal a role of small‐scale heterogeneity , 2018, Ecology and evolution.

[7]  Shinichi Nakagawa,et al.  Fixed‐effect variance and the estimation of repeatabilities and heritabilities: issues and solutions , 2018, Journal of evolutionary biology.

[8]  Martin A. Stoffel,et al.  rptR: repeatability estimation and variance decomposition by generalized linear mixed‐effects models , 2017 .

[9]  Byron C. Jaeger,et al.  An R2 statistic for fixed effects in the generalized linear mixed model , 2017 .

[10]  R. Henson,et al.  The Use of Structure Coefficients to Address Multicollinearity in Sport and Exercise Science , 2017 .

[11]  H. Schielzeth,et al.  The coefficient of determination R2 and intra-class correlation coefficient from generalized linear mixed-effects models revisited and expanded , 2016, bioRxiv.

[12]  Olaf Conrad,et al.  Climatologies at high resolution for the earth’s land surface areas , 2016, Scientific Data.

[13]  Seongho Kim ppcor: An R Package for a Fast Calculation to Semi-partial Correlation Coefficients. , 2015, Communications for statistical applications and methods.

[14]  Xavier A. Harrison,et al.  Using observation-level random effects to model overdispersion in count data in ecology and evolution , 2014, PeerJ.

[15]  J. Faraway Linear Models with R , 2014 .

[16]  D. Bates,et al.  Fitting Linear Mixed-Effects Models Using lme4 , 2014, 1406.5823.

[17]  Kim Nimon,et al.  Using commonality analysis in multiple regressions: a tool to decompose regression effects in the face of multicollinearity , 2014 .

[18]  G. Andrew,et al.  arm: Data Analysis Using Regression and Multilevel/Hierarchical Models , 2014 .

[19]  R Core Team,et al.  R: A language and environment for statistical computing. , 2014 .

[20]  Shinichi Nakagawa,et al.  A general and simple method for obtaining R2 from generalized linear mixed‐effects models , 2013 .

[21]  Kim F. Nimon,et al.  Interpreting Multiple Linear Regression: A Guidebook of Variable Importance , 2012 .

[22]  Shinichi Nakagawa,et al.  Repeatability for Gaussian and non‐Gaussian data: a practical guide for biologists , 2010, Biological reviews of the Cambridge Philosophical Society.

[23]  H. Schielzeth Simple means to improve the interpretability of regression coefficients , 2010 .

[24]  Joseph Hilbe,et al.  Data Analysis Using Regression and Multilevel/Hierarchical Models , 2009 .

[25]  K. Muller,et al.  An R2 statistic for fixed effects in the linear mixed model , 2008, Statistics in medicine.

[26]  Kim Nimon,et al.  An R package to compute commonality coefficients in the multiple regression case: An introduction to the package and a practical example , 2008, Behavior research methods.

[27]  Bruce Thompson,et al.  Commonality Analysis: Partitioning Variance to Facilitate Better Understanding of Data , 2006 .

[28]  Andrew Gelman,et al.  Data Analysis Using Regression and Multilevel/Hierarchical Models , 2006 .

[29]  Timothy J. Robinson,et al.  Linear Models With R , 2005, Technometrics.

[30]  R. Xu Measuring explained variation in linear mixed effects models , 2003, Statistics in medicine.

[31]  P. M. Berthouex,et al.  The Coefficient of Determination, R^2 , 2002 .

[32]  Robert D. McPhee,et al.  Commonality Analysis: A Method for Decomposing Explained Variance in Multiple Regression Analyses. , 1979 .

[33]  Michael Satosi Watanabe,et al.  Information Theoretical Analysis of Multivariate Correlation , 1960, IBM J. Res. Dev..