Skip to contents

Estimate variable importance and partial dependence plots of a INLA model

Usage

inv_variables_inla(
  cv_set,
  y_var,
  pred_vars,
  reff_var = NULL,
  id_vars,
  hyper_priors = list(prec.unstruct = c(1, 5e-04), prec.spatial = c(1, 5e-04),
    prec.timerw1 = c(1, 0.01)),
  W_orgUnit,
  var_scales,
  constant_org,
  constant_date,
  seed = 8675309,
  nsims = 1
)

Arguments

cv_set

list object containing analysis and assessment data.frames

y_var

string name of column of observed values

pred_vars

vector string of predictor variables to use in model

reff_var

string or formula for random effects

id_vars

names of columns used as keys/ids in data.frames

hyper_priors

priors for spatial and temporal random effects

W_orgUnit

graph of orgUnit to use in spatial structure. If NULL (default), will not fit a spatial structure.

var_scales

data.frame containing centering and scaling parameters for variables

constant_org

orgUnit to use in counterfactual plots

constant_date

date to use in counterfactual plots

seed

a seed to use for reproducability. Default = 8675309

nsims

number of simulations to run. Default = 1

Value

list containing variable importance scores and a list of dataframes containing data for pdp plots with each element corresponding to a variable