process_fold_mean_diff: Process one cross-validation fold for mean difference testing

View source: R/41_refined_anchored_lasso.R

process_fold_mean_diffR Documentation

Process one cross-validation fold for mean difference testing

Description

Computes the test statistic, variance, and projection direction for one fold in a cross-validated comparison of two groups.

Usage

process_fold_mean_diff(
  fold_index,
  control,
  treatment,
  control_split_index,
  tr_split_index,
  pca_method,
  classifier_method,
  lambda_type,
  group,
  verbose
)

Arguments

fold_index

Integer index of the current fold.

control

Matrix or data frame for the control group (rows = samples, columns = features).

treatment

Matrix or data frame for the treatment group (rows = samples, columns = features).

control_split_index

A list of row indices for each fold of the control group.

tr_split_index

A list of row indices for each fold of the treatment group.

pca_method

Character. PCA method to use. Options are "dense_pca" or "sparse_pca".

classifier_method

Character. Classifier method. Options are "lasso" or "group_lasso".

lambda_type

Character. Lambda selection method. Options are "lambda.min" or "lambda.1se".

group

Optional grouping vector for group lasso.

verbose

Logical. Whether to print progress messages.

Value

A list containing the test statistic, its variance, scores for each group, the projection direction, and intermediate quantities.


HMC documentation built on June 8, 2025, 10:32 a.m.