barp_partial_dependence | R Documentation |
This function calculates the partial dependence for selected covariates based on a BARP
object. The user can specify up to three covariates, resulting in a three-way interaction.
barp_partial_dependence( barp.obj, vars = NULL, prop_data = 0.1, credible_interval = c(0.025, 0.975), setSeed = NULL )
vars |
The variable names or column indices of interest. #' @param vars The variable names or column indices of interest. If a character vector, values at which to evaluate partial dependences based on quantiles c(0.05,seq(.1,.9,by = .1),.95). |
prop_data |
The percentage of the original data to use for estimation. Larger values are more time consuming. |
credible_interval |
The credible interval for the estimates. |
setSeed |
Seed to control random number generation. |
barp |
A |
... |
Additional arguments to be passed to bartMachine. |
Returns an object of class "barpd", containing a list of the following components:
summary |
A |
raw |
A |
barp
which generates the prerequisite barp
object.
data("gaymar") barp.obj <- barp(y = "supp_gaymar", x = c("pvote","religcon","age","educ","gXr","stateid","region"), dat = svy, census = census06, geo.unit = "stateid", proportion = "n") bpd <- barp_partial_dependence(barp = barp.obj, vars = list(region = 1:4,educ = 1:4), prop_data = .2, credible_interval = c(0.025,0.975), setSeed = 1021)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.