Generalized linear mixed models (GLMMs) have been widely used in contemporary ecology studies. However, determination of the relative importance of collinear predictors (i.e. fixed effects) to response variables is one of the challenges in GLMMs. Here we developed a novel R package, glmm.hp, to decompose marginal R2 explained by fixed effects in GLMMs. The algorithm of glmm.hp is based on the recently proposed approach “average shared variance” that is used for multivariate analysis. We explained the principle and demonstrated the use of this package by simulated dataset. The output of glmm.hp shows individual marginal R2s that can be used to evaluate the relative importance of predictors, which sums up to the overall marginal R2. Overall, we believe the glmm.hp package will be helpful in the interpretation of GLMM outcomes.
glmm.hp is an R package designed to evaluate the relative importance of collinear predictors within generalized linear mixed models (GLMMs). Since its initial release in January 2022, it has rapidly gained recognition and popularity among ecologists. However, the previous glmm.hp package was limited to work GLMMs derived exclusively from the lme4 and nlme packages. The latest glmm.hp package however, brings new improvements. It has integrated results obtained from the glmmTMB package, enabling it to handle Zero-Inflated Generalized Linear Mixed Models effectively. Furthermore, it has introduced the new functionalities of commonality analysis and hierarchical partitioning for multiple linear regression models, considering both unadjusted R2 and adjusted R2. This paper will serve as a demonstration of these new functionalities, making them more accessible to users.
The programming language R is widely used in many fields. We explored the extent of reported R use in the field of ecology using the Web of Science and text mining. We analyzed the frequencies of R packages reported in more than 60,000 peer‐reviewed articles published in 30 ecology journals during a 10‐yr period ending in 2017. The number of studies reported using R as their primary tool in data analysis increased linearly from 11.4% in 2008 to 58.0% in 2017. The top 10 packages reported were lme4, vegan, nlme, ape, MuMIn, MASS, mgcv, ade4, multcomp, and car. The increasing popularity of R has most likely furthered open science in ecological research because it can improve reproducibility of analyses and captures workflows when scripts and codes are included and shared. These findings may not be entirely unique to R because there are other programming languages used by ecologists, but they do strongly suggest that given the relatively high frequency of reported use of R, it is a significant component of contemporary analytics in the field of ecology.
Generalized Additive Models (GAMs) are widely employed in ecological research, serving as a powerful tool for ecologists to explore complex nonlinear relationships between a response variable and predictors. Nevertheless, evaluating the relative importance of predictors with concurvity (analogous to collinearity) on response variables in GAMs remains a challenge. To address this challenge, we developed an R package named gam.hp. gam.hp calculates individual R2 values for predictors, based on the concept of 'average shared variance', a method previously introduced for multiple regression and canonical analyses. Through these individual R2s, which add up to the overall R2, researchers can evaluate the relative importance of each predictor within GAMs. We illustrate the utility of the gam.hp package by evaluating the relative importance of emission sources and meteorological factors in explaining ozone concentration variability in air quality data from London, UK. We believe that the gam.hp package will improve the interpretation of results obtained from GAMs.