barp_prognostic_covs: barp_prognostic_covs

View source: R/barp_prognostic_covs.R

barp_prognostic_covsR Documentation

barp_prognostic_covs

Description

This function extracts the relative prognostic power of the covariates used in the BARP model. The user can choose to evaluate the statistical significance of these metrics by setting perm_test to TRUE. Doing so re-esetimates variable inclusion proportions (in either trees or splits) after randomly permuting the outcome variable. These permuted inclusion proportions are used as a null distribution against which the average observed proportions are compared.

Usage

barp_prognostic_covs(
  barp.obj,
  interactions = F,
  perm_test = T,
  num_reps = 10,
  num_trees = 20,
  num_permute = 10,
  type = "splits",
  setSeed = NULL,
  ...
)

Arguments

interactions

A logical statement for whether to evaluate individual variables or their pairwise interactions. Defaults to FALSE.

perm_test

A logical statement for whether to evaluate covariate significance via permutation tests. Defaults to FALSE.

num_reps

The number of reps used to estimate the average inclusion proportions and standard deviation.

num_trees

The number of trees to be used.

num_permute

The number of permutation simulations.

type

The context in which to evaluate the proportion of variable inclusion, either in terms of trees or in terms of splits.

setSeed

Seed to control random number generation.

BARP

A BARP object.

Value

Returns an object of class "barpcov", containing a list of the following components:

covariate_importance

A matrix containing the raw estimated inclusion proportions for the covariates.

type

An indicator for which type was used to estimate variable importance.

permutation_test

A matrix containing the raw estimated inclusion proportions for the covariates estimated under the permuted null relationship. Only included if perm_test = TRUE.

p_vals

A vector containing the p-values for each variable from the permutation test. These specifically correspond to the percentabe of the null proportions that are less than or equal to the observed average proportion. Only included if perm_test = TRUE.

See Also

BARP which generates the prerequisite BARP 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')

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