plot.barpcov: plot.barpcov

View source: R/plot.barpcov.R

plot.barpcovR Documentation

plot.barpcov

Description

This function plots the covariate importance.

Usage

## S3 method for class 'barpcov'
plot(barpcov, topn = 10, var_names = NULL, sig_level = NULL)

Arguments

barpcov

A barp_prognostic_covs covariate importance object of class "barpcov".

var_names

A vector of variable names. If NULL (the default) the variable names are taken from the BARP covariate importance object.

sig_level

The significance level at which to evaluate covariate significance. Only applicable for BARP covariate importance objects that included a permutation test. Defaults to 0.05.

See Also

barp_prognostic_covs which creates the prerequisite barpcov object.

Examples

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")
barpcov <- barp_prognostic_covs(barp.obj,
                                interactions = F,
                                perm_test = T,
                                num_reps = 30,
                                num_trees = 20,
                                num_permute = 30,
                                type = 'splits')
plot.barpcov(barpcov,
             var_names = c("Presidential Vote","Religious-Conservative",
                           "Age","Education","Gender X Race","State","Region"),
             sig_level = 0.05)

jbisbee1/BARP documentation built on Jan. 5, 2023, 9:15 a.m.