Skip to contents

Runs stratified random subsets through a permutation-based interaction effect pipeline in parallel using C++ core logic. Uses future and furrr for parallelization with automatic plan handling.

Usage

subset_perm_interaction_effect(
  X,
  Y,
  MX,
  MY,
  g_col,
  n_iter = 1000,
  B = 1000,
  save_null = FALSE,
  seed = NULL,
  workers = future::availableCores() - 1
)

Arguments

X

Data frame or matrix of predictors.

Y

Outcome variable or matrix.

MX

Covariates for the test split.

MY

Covariates for the inference split.

g_col

Name of the grouping or genotype column.

n_iter

Number of random subsets to run. Default: 1000.

B

Number of permutations per subset. Default: 1000.

save_null

Store full permutation null matrix? Default: FALSE.

seed

Optional seed for reproducibility. Default: NULL.

workers

Number of parallel workers. Default: availableCores()-1.

Value

A list with aggregated stats, iteration stats, sample log, permutation nulls (optional), and meta information.

Details

The function sets a parallel plan with `multisession` and restores the previous plan automatically.