var_importance {enmpa} | R Documentation |
Variable importance for GLMs
Description
Calculates the relative importance of predictor variables based on the concept of explained deviance. This is achieved by fitting a GLMs multiple times, each time leaving out a different predictor variable to observe its impact on the model's performance.
Usage
var_importance(fitted, modelID = NULL, data = NULL)
Arguments
fitted |
an object of class |
modelID |
(character) vector of ModelID(s) to be considered when the
|
data |
data.frame or matrix of data used in the model calibration step. It must be defined in case the model entered does not explicitly include a data component. Default = NULL. |
Details
The process begins by fitting the full GLM model, which includes all predictor variables. Subsequently, separate GLM models are fitted, excluding one variable at a time to assess the influence of its absence on the model's performance. By systematically evaluating the effect of removing each predictor variable, the function provides valuable insights into their individual contributions to the model's overall performance and explanatory power.
Value
A data.frame containing the relative contribution of each variable. An
identification for distinct models is added if fitted
contains multiple
models.
Examples
# Load a fitted selected model
data(sel_fit, package = "enmpa")
# Variable importance for single models
var_importance(sel_fit, modelID = "ModelID_7")
# Variable importance for multiple models (only one model in this list)
var_importance(sel_fit)