plot.bpd | R Documentation |
This function plots the partial dependence results estimated returned by running barp_partial_dependence.
## S3 method for class 'bpd' plot( bpd, var_names = NULL, var_labs = NULL, is_categorical = NULL, cols = c("#f2f0f7", "#cbc9e2", "#9e9ac8", "#6a51a3"), ... )
bpd |
A |
var_names |
A vector of variable names. If |
var_labs |
A list of variable labels corresponding to the levels at which the partial dependence was calculated. If |
is_categorical |
A vector of logicals (T,F) corresponding to which variables are categorical and which are continuous.If |
... |
Additional arguments to be passed to plot. |
barp_partial_dependence
which is a prerequisite to plotting.
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 = c("age","educ"), prop_data = .2, levs = list(c(1:4),c(1:4), credible_interval = c(0.025,0.975))) plot(bpd, var_names = c("Age","Education"), var_labs = list(c("18-30","31-50","51-65","65+"), c("LTHS","HS","Some Coll","Coll+")), is_categorical = c(T,T))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.