Compute bootstrap-based standard error estimates for variable importance

bootstrap_se(
  Y = NULL,
  f1 = NULL,
  f2 = NULL,
  cluster_id = NULL,
  clustered = FALSE,
  type = "r_squared",
  b = 1000,
  boot_interval_type = "perc",
  alpha = 0.05
)

Arguments

Y

the outcome.

f1

the fitted values from a flexible estimation technique regressing Y on X. A vector of the same length as Y; if sample-splitting is desired, then the value of f1 at each position should be the result of predicting from a model trained without that observation.

f2

the fitted values from a flexible estimation technique regressing either (a) f1 or (b) Y on X withholding the columns in indx. A vector of the same length as Y; if sample-splitting is desired, then the value of f2 at each position should be the result of predicting from a model trained without that observation.

cluster_id

vector of the same length as Y giving the cluster IDs used for the clustered bootstrap, if clustered is TRUE.

clustered

should the bootstrap resamples be performed on clusters rather than individual observations? Defaults to FALSE.

type

the type of importance to compute; defaults to r_squared, but other supported options are auc, accuracy, deviance, and anova.

b

the number of bootstrap replicates (only used if bootstrap = TRUE and sample_splitting = FALSE); defaults to 1000.

boot_interval_type

the type of bootstrap interval (one of "norm", "basic", "stud", "perc", or "bca", as in boot{boot.ci}) if requested. Defaults to "perc".

alpha

the level to compute the confidence interval at. Defaults to 0.05, corresponding to a 95% confidence interval.

Value

a bootstrap-based standard error estimate