vibe.gam: Variable Importance calculation for a 'gam' object

View source: R/gam_vibes.R

vibe.gamR Documentation

Variable Importance calculation for a gam object

Description

vibe.gam takes a fitted mgcv::gam() object and calculates variable importance metrics by fitting the submodels required, extracting the desired goodness-of-fit metric and applying variable importance metrics to it.

Usage

## S3 method for class 'gam'
vibe(object, varimp = "hp", gof = "R2e", ncores = 1, progress = TRUE, ...)

Arguments

object

A gam object, typically result of mgcv::gam().

varimp

One of c("hp", "relweights"), which stand for hierarchical partitioning and relative weights.

gof

Goodness-of-fit metric, the changes of which shall be analysed

ncores

Number of cores used for the model fitting process, happening in part_core.

progress

Boolean. Do you want to see a progress bar?

...

Other arguments

Examples

library("mgcv")
gam_ocat <- gam(
  satisfaction ~ admin + hygiene + time_appointment +
    quality_dr + diagnosis_exactness + equipment_modern +
    friendly_workers + parking_playingrooms_cafes,
  data = vibe::sat, family = ocat(R = 3)
)
hp_gam <- vibe(gam_ocat, varimp = "hp", gof = "R2e", progress = FALSE)
rw_gam <- vibe(gam_ocat, varimp = "relweights", gof = "R2e")
print(hp_gam)
print(rw_gam)

Stan125/vibe documentation built on June 6, 2024, 11:36 a.m.