run_all_enr_fit_mets: fp_msd_class2_fp_msd_multi function

View source: R/enr functions.R

run_all_enr_fit_metsR Documentation

fp_msd_class2_fp_msd_multi function

Description

Uses cross validation ENR functions to consecutively check maximization of multiple performance metrics (DOCUMENTATION COMING- CURRENT DOCUMENTATION INCORRECT)

Usage

run_all_enr_fit_mets(
  dat,
  response_var,
  tune_type = "og",
  modname = "model",
  specs = TRUE,
  date_tf = TRUE,
  time_tf = FALSE,
  ties_measure = "mode",
  fit_mets = c("acc", "balacc", "ppv", "f1", "sens", "auroc", "npv", "spec", "logloss"),
  dir_name =
    "I:/Lagisetty SDR Misuse/5. Identifiable Data/E. Database/treatment arm creation/treatment arm creation/enr mods/",
  iter = 50,
  k = 10,
  num_alpha = 20,
  eq_wt = FALSE,
  lr_cutoff = seq(from = 0.05, to = 0.95, by = 0.05),
  ...
)

Arguments

data

data frame containing the data to be summarized

indvars

vector of variable names for the variables that are t be summarized. all variables must be present in the data frame

classvar

optional class variable to cross with the independent variables. this is is typically presented as a text (e.g. data$variable)vector of names to change the rows in column 1 to. This is typically what you want the individual variables that the rows represent called in the table. this must be the same length as vars. default is NULL which simply returns vars.

fp_msd_vector_tf

vector of boolean values indicating whether the variable should be 'fp' (true) or custom/msd (false). default is true

funct1_vector

a vector of the first function to use (i.e. outside the parentheses) if fp='FALSE'. default is 'mean'. if supplying different functions be sure to quote e.g. "IQR"

funct2_vector

a vector of the second function to use (i.e. inside the parentheses) if fp='FALSE'. default is 'sd'. if supplying different functions be sure to quote e.g. "IQR"

var_name_vec

a vector of variable names to use in the table. If left as null the table will contain the variable names as listed in the data frame

sep_var_level

boolean value indicating whether the variable name should be added to the table (TRUE) or not (FALSE). default is TRUE

remove_var_dups

boolean indicating whether duplicate values of the variable name should be removed (TRUE) or included (FALSE). default is TRUE

shownval

boolean indicating if the n value used after na removal should be displayed in non fp cases. this will only appear when fp=FASLE. default is TRUE

total

boolean indicating if a 'total' column should be added to the data frame. default is TRUE

rnd_digs_vector

the number of digits to round results to when fp=FALSE. default is 2

rownvar

name of the first column (second column if sep_var_level=TRUE) which contains either indvar categories or function names. default is 'Level'

count_miss

switch determining if NA values should be added to the indvar frequencies as it's own category. if this is 'ifmiss' then missing will be added. if this is 'none' then missing will be excluded and a message will show number of records removed. default is 'ifmiss'

count_miss_lab

if count_miss='ifmiss' meaning we want NA values included this argument determines what they are labeled as. default is 'Missing'

Examples

fp_msd_class2_fp_msd_multi_function()


clmacleod/highlandr documentation built on Feb. 18, 2025, 1:31 p.m.