bsPDP.caret: Bootstrapped partial dependence plots for 'caret' functions

Description Usage Arguments Value References

View source: R/bsPDP_caret.R

Description

Evaluates a models in the caret package for n_boot bootstrap iterations to obtain confidence bands for the estimated PDP.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
bsPDP.caret(
  formula,
  variable = NULL,
  data,
  newdata = NULL,
  grid = NULL,
  outcome = NULL,
  n_boot = 100,
  p_boot = 0.6,
  N = 1000,
  label = NULL,
  clock = FALSE,
  test = FALSE,
  seed = 8675309,
  trainMethod = "rf",
  ...
)

Arguments

formula

is an output formula for the outcome.

variable

is the treatment variable.

data

is a data frame to be used for the training.

newdata

is an optional data frame of test data for the PDPs.

grid

sets the values of variable to evaluate the default is 100 values in range of variable: grid = seq(min(x), max(x), length.out = 100).

n_boot

is the number of bootstrap replications.

p_boot

is the proportion of the data to select for each bootstrap replication.

N

is the number of observations to select for calculating the PDPs.

label

is a character-string variable label for variable.

clock

is a logical indicating whether to time each bootstrap replication.

test

is a logical indicating whether to calculate the pdp for both the data and newdata.

seed

is a random seed (default is 8675309).

trainMethod

is the train method for the estimation default is "rf" (random forest). For details, see http://topepo.github.io/caret/using-your-own-model-in-train.html.

...

additional arguments for the train function, see ?train or http://topepo.github.io/caret/using-your-own-model-in-train.html. We recommended checking settings for trControl = trainControl() (control the computational nuances of the train function, see ?trainControl) and tuneGrid (a data frame with possible tuning values).

Value

bsPDPcaret returns an object with class "bsPDP," a list that includes the following components:

variable

the treatment variable.

pdpData

the estimated average predictions and standard errors along variable.

trainData

the original training data.

testData

the test data.

outcome

the outcome class (NULL for outcomes with numeric class).

method

the method (c("caret", method))

References

Yakusheva, Olga; Bang, James T; Bobay, Kathleen; Hughes, Ronda G; Costa, Linda; and Weiss, Marianne (2021, Forthcoming). Health Services Research.


bangecon/bsPDP documentation built on Dec. 19, 2021, 6:41 a.m.