prep5STAR: Prepares data for 5-STAR algorithm

View source: R/5STARcorefun.R

prep5STARR Documentation

Prepares data for 5-STAR algorithm

Description

Cleans covariate matrix, removing covariates with too much missingess or those that can't be split on (i.e., due to too few obs/minor levels), and coverts all character covariates into factors

Usage

prep5STAR(yy, X, family = "cox", missthreshold = c(0.1, 0.2),
  verbose = 0, minbucket)

Arguments

yy

Trait/response (a Surv() object summarizing follow-up time for right-censored data and status indicator where 1=dead, 0=censored). Ignored for family != "cox"

X

Data frame of all possible stratification covariates

family

Trait family, current options: "cox", "binomial", or "gaussian"

missthreshold

Vector of lower and upper bound of acceptable missingness levels for each covariate, such that covariates with less than the first missthreshold value will be passed to step 2 (filtering step), those with missingess greater than the second missthreshold value will be removed from analysis, and those with missingness between these two values will be included only if they are significantly correlated with the outcome scores (e.g., logrank scores). If a scalar is entered, covariates with less than that amount of missingness will be included and those with greater will be removed. For family other than "cox", only the first value is used.

verbose

Numeric variable indicating amount of information to print to the terminal (0 = nothing, 1 = notes only, 2 = notes and intermediate output)

minbucket

Minimum number of subjects/terminal node

Value

  • X: cleaned covariate matrix


rmarceauwest/fiveSTAR documentation built on June 30, 2023, 7:38 a.m.