Searches for subgroups with treatment effect heterogeneity using combinations of candidate factors. Evaluates subgroups for minimum prevalence, event counts, and hazard ratio threshold. Parallelizes the main search loop.
subgroup.search(
Y,
Event,
Treat,
ID = NULL,
Z,
n.min = 30,
d0.min = 15,
d1.min = 15,
hr.threshold = 1,
max.minutes = 30,
minp = 0.05,
rmin = 5,
details = FALSE,
maxk = 2,
parallel_workers = parallel::detectCores()
)List with found subgroups, maximum HR, search time, configuration info, and filtering statistics.
Numeric vector of outcome (e.g., time-to-event).
Numeric vector of event indicators (0/1).
Numeric vector of treatment group indicators (0/1).
Optional vector of subject IDs.
Matrix or data frame of candidate subgroup factors (binary indicators).
Integer. Minimum subgroup size.
Integer. Minimum number of events in control.
Integer. Minimum number of events in treatment.
Numeric. Hazard ratio threshold for subgroup selection.
Numeric. Maximum minutes for search.
Numeric. Minimum prevalence rate for each factor.
Integer. Minimum required reduction in sample size when adding a factor.
Logical. Print details during execution.
Integer. Maximum number of factors in a subgroup.
Integer. Number of parallel workers (default: all available cores).