The function to test the lda model

ldaTest(
  model,
  preds,
  data,
  pred_var,
  group_var = NULL,
  control_vars = c(),
  test_method,
  p_adjust_method = "fdr",
  seed = 42,
  load_dir = NULL,
  save_dir = "./results"
)

Arguments

model

(list) The trained model

preds

(tibble) The predictions

data

(tibble) The data to test on

pred_var

(string) The variable to be predicted (only needed for regression or correlation)

group_var

(string) The variable to group by (only needed for t-test)

control_vars

(vector) The control variables

test_method

(string) The test method to use, either "correlation","t-test", "linear_regression","logistic_regression", or "ridge_regression"

p_adjust_method

(character) Method to adjust/correct p-values for multiple comparisons (default = "none"; see also "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr").

seed

(integer) The seed to set for reproducibility

load_dir

(string) The directory to load the test from, if NULL, the test will not be loaded

save_dir

(string) The directory to save the test, if NULL, the test will not be saved

Value

A list of the test results, test method, and prediction variable