Run g-BKMR analysis

gbkmr_run(
  data,
  outcome = "Y",
  outcome_type = c("continuous", "binary"),
  time_points,
  currind = 1,
  sel = NULL,
  n = NULL,
  K = 1000,
  iter = 15000,
  n_knots = 50,
  engine = c("auto", "bkmr", "fastbkmr"),
  n_subset = NULL,
  n_cores = NULL,
  a_probs = c(0.25, 0.75),
  a_vals = NULL,
  astar_vals = NULL,
  verbose = TRUE
)

Arguments

data

Data frame in g-BKMR format (see prepare_gbkmr_data).

outcome

Character. Outcome variable name (default: "Y").

outcome_type

Character. "continuous" or "binary".

time_points

Integer. Number of time points.

currind

Integer. Random seed.

sel

Numeric vector. Post-burn-in MCMC indices (auto-calculated if NULL).

n

Integer. Sample size (default: min(500, nrow(data))).

K

Integer. Monte Carlo samples.

iter

Integer. Total MCMC iterations.

n_knots

Integer. Knots for kernel approximation.

engine

Character. "auto" (default), "bkmr", or "fastbkmr". When "auto", the engine is selected based on sample size: standard BKMR for n <= 2000, fast BKMR for n > 2000 (if fbkmr is installed).

n_subset

Integer or NULL. Number of subsets for fastBKMR. If NULL (default), auto-calculated as max(5, floor(n / 1000)).

n_cores

Integer or NULL. Number of parallel cores for fastBKMR. If NULL (default), auto-calculated as min(n_subset, available cores, 10).

a_probs

Numeric vector of length 2. Quantile probabilities for intervention levels (default: c(0.25, 0.75)).

a_vals

Named numeric vector or NULL. Custom low-exposure values.

astar_vals

Named numeric vector or NULL. Custom high-exposure values.

verbose

Logical. Print progress.

Value

Object of class "gbkmr_results".