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)

Arguments

fitted

an object of class glm or a list of GLMs obtained using the functions fit_selected or fit_glms.

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_7)

# Variable importance for multiple models (only one model in this list)
var_importance(sel_fit)

[Package enmpa version 0.1.5 Index]