bsPDP.glm: Bootstrapped partial dependence plots for the 'glm' estimator

Description Usage Arguments Value

View source: R/bsPDP_glm.R

Description

Evaluates a Generalized Linear Models 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
bsPDP.glm(
  formula,
  variable = NULL,
  data,
  newdata = NULL,
  grid = NULL,
  outcome = NULL,
  n_boot = 100,
  p_boot = 0.6,
  N = 1000,
  label = NULL,
  test = FALSE,
  seed = 8675309,
  ...
)

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

outcome

is the outcome class to be predicted for classification problems.

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.

test

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

seed

is a random seed (default is 8675309).

...

additional arguments for the glm function (e.g. family).

Value

bsPDPglm 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).

trControl

is not applicable for this method (NULL).


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