Update: This new R package gam.hp
seems to be the solution I have been looking for:
It contains basically one function (gam.hp()
) that takes GAMs and GAMMs constructed with the mgcv
package and calculatesdecomposes either Adjusted R² or explained Deviance from the model into relative contributions per each predictor inof the model formula.
It also calculates which fraction of the explained deviance or R² is uniquely attributable to a certain predictor and the publication reference below discusses in how far that it useful to consider. Computation can take a while for complexer models.
Further details see here:
Reference:
Lai J, Tang J, Li T, Zhang A, Mao L (2024) Evaluating the relative importance of predictors in Generalized Additive Models using the gam.hp R package. Plant Diversity, 46, 542-546. [Link]