Learn R Programming

forestsearch

Exploratory subgroup identification in clinical trials with survival endpoints using bootstrap bias correction.

forestsearch implements the Forest Search methodology described in Leon et al. (2024), "Exploratory subgroup identification in the heterogeneous Cox model," Statistics in Medicine. The package screens all possible subgroups (formed by combinations of baseline factors) against Cox hazard ratio thresholds indicative of harm, selects the subgroup "maximally consistent with harm" via split-sample evaluation, and provides bias-corrected treatment effect estimates with valid confidence intervals through an infinitesimal jackknife bootstrap procedure.

Overview

In randomized clinical trials, important subgroups based on patient characteristics may not be anticipated or well understood prior to the trial. Forest Search addresses the need for exploratory, post-hoc subgroup identification by:

  1. Constructing candidate factors via LASSO, Generalized Random Forests (GRF), and quartile-based binary splits.
  2. Enumerating all one- and two-factor subgroup combinations meeting minimum sample size and event criteria.
  3. Screening candidates against a hazard ratio threshold (default HR >= 1.25) and evaluating split-sample consistency across repeated random 50/50 splits (default R = 400).
  4. Selecting the subgroup with the highest consistency rate (>= 90%) as the estimated detrimental subgroup.
  5. Correcting for selection bias via bootstrap bias correction with infinitesimal jackknife variance estimation.
  6. Validating stability through N-fold (leave-one-out) and K-fold cross-validation.

By reversing the treatment indicator, the same framework identifies subgroups with substantial benefit.

Installation

You can install the development version of forestsearch from GitHub:

# install.packages("pak")
pak::pak("larry-leon/forestsearch")

Or using remotes:

# install.packages("remotes")
remotes::install_github("larry-leon/forestsearch")

The package depends on weightedsurv, which is installed automatically from GitHub via the Remotes field in the DESCRIPTION.

Quick Start

library(forestsearch)

# --- Step 1: Run ForestSearch ---
fs <- forestsearch(
  df.analysis     = trial_data,
  outcome.name    = "tte",
  event.name      = "event",
  treat.name      = "treat",
  confounders.name = c("age", "biomarker", "stage", "region"),
  sg_focus        = "maxSG",
  hr.threshold    = 1.25,
  hr.consistency  = 1.0,
  pconsistency.threshold = 0.90,
  fs.splits       = 400,
  use_lasso       = TRUE,
  use_grf         = TRUE,
  parallel_args   = list(plan = "multisession", workers = 4)
)

print(fs)
summary(fs)

# --- Step 2: Bootstrap Bias Correction ---
fs_bc <- forestsearch_bootstrap_dofuture(
  fs.est    = fs,
  nb_boots  = 2000,
  parallel_args = list(plan = "multisession", workers = 6)
)

# Publication-ready tables
summaries <- summarize_bootstrap_results(fs_bc)
summaries$main_table_gt

# --- Step 3: Cross-Validation ---
# K-fold CV (repeated 10-fold)
fs_cv <- forestsearch_tenfold(
  fs.est  = fs,
  sims    = 200,
  Kfolds  = 10,
  parallel_args = list(plan = "multisession", workers = 6)
)

cv_metrics_tables(fs_cv)

# N-fold (leave-one-out) CV
fs_oob <- forestsearch_Kfold(
  fs.est  = fs,
  Kfolds  = nrow(trial_data),
  parallel_args = list(plan = "multisession", workers = 6)
)

# --- Step 4: Visualization ---
# Forest plot with bias-corrected estimates and CV metrics
plot_subgroup_results_forestplot(
  fs_results  = list(fs.est = fs, fs_bc = fs_bc, fs_kfold = fs_cv),
  df_analysis = trial_data,
  outcome.name = "tte",
  event.name   = "event",
  treat.name   = "treat"
)

# Weighted Kaplan-Meier curves by subgroup
plot_sg_weighted_km(fs, fs_bc = fs_bc)

Key Features

Core Algorithm

FeatureDescription
forestsearch()Main search engine: LASSO/GRF candidate selection, exhaustive enumeration, consistency evaluation
subgroup.consistency()Split-sample consistency with optional two-stage sequential early stopping
select_best_subgroup()Multiple selection criteria: "hr", "maxSG", "minSG", "hrMaxSG", "hrMinSG"

Bootstrap Inference

FeatureDescription
forestsearch_bootstrap_dofuture()Parallelised bootstrap with doFuture; full algorithm mimicked in each replicate
Bias correctionTwo-source correction on the log-HR scale (Leon et al., Eq. 6--7)
IJ varianceInfinitesimal jackknife variance estimation for valid confidence intervals
summarize_bootstrap_results()Publication-ready gt tables with diagnostics

Cross-Validation

FeatureDescription
forestsearch_Kfold()N-fold (leave-one-out) CV for algorithmic stability assessment
forestsearch_tenfold()Repeated K-fold CV (e.g., 200 x 10-fold)
cv_metrics_tables()sensCV, ppvCV, and exact-match correspondence metrics

Visualization

FeatureDescription
plot_subgroup_results_forestplot()Forest plot with bias-corrected HRs, reference subgroups, and CV annotations
plot_sg_weighted_km()Weighted Kaplan-Meier curves for identified subgroups
plot_km_band_forestsearch()Multi-subgroup KM comparison bands
plot_spline_treatment_effect()Spline-based treatment effect curves
plot_detection_curve()Power/detection probability across effect sizes

Simulation Framework

FeatureDescription
generate_aft_dgm_flex()Flexible AFT data-generating mechanism with configurable heterogeneity
create_gbsg_dgm()GBSG-based DGM for replicating paper simulations
run_simulation_analysis()Full simulation wrapper: FS, FS+GRF, and standalone GRF
summarize_simulation_results()Operating characteristics tables (type-1 error, power, sensitivity, PPV)

Multi-Regional Clinical Trials

FeatureDescription
mrct_region_sims()Regional consistency evaluation in MRCTs
create_dgm_for_mrct()DGM with region-level heterogeneity

Methodology at a Glance

Forest Search identifies the subgroup maximally consistent with harm through the following procedure:

Candidate Factors ──► Enumerate Subgroups ──► HR Screening (≥ 1.25)
                                                     │
                                              Consistency Evaluation
                                              (R = 400 random 50/50 splits)
                                                     │
                                              Select Ĥ (consistency ≥ 90%)
                                                     │
                                              Bootstrap Bias Correction
                                              (B = 300–2000 replicates)

The bias-corrected estimator accounts for two sources of optimism:

β̂*(Ĥ) = β̂(Ĥ) − (1/B) Σ [η*_b(Ĥ*_b) + η*_b(Ĥ)]

where η*_b(Ĥ*_b) and η*_b(Ĥ) capture the discrepancies between bootstrap and observed data estimates for the bootstrap-selected and observed subgroups, respectively. Confidence intervals use the infinitesimal jackknife variance estimator.

Simulation studies (20,000 replicates) demonstrate:

  • Type-1 error ≤ 3% for FS with LASSO (FS_l), even with noise factors
  • Power 71--96% for detecting HR = 2.0 subgroups (N = 300--700)
  • Conservative estimation: bias-corrected estimates underestimate harm and overestimate benefit---a favorable property for exploratory analyses
  • Oracle CI coverage ≥ 95% across all scenarios

Requirements

  • R ≥ 4.1.0
  • Key dependencies: survival, data.table, glmnet, grf, doFuture, future, ggplot2, gt
  • Optional: forestploter (forest plots), DiagrammeR (diagrams), cubature (numerical integration)

Documentation

  • Getting Started vignette: vignette("forestsearch") --- end-to-end walkthrough with the GBSG breast cancer trial
  • Methodology vignette: vignette("methodology") --- detailed statistical framework, algorithm, simulation results, and applications
  • pkgdown site: https://larry-leon.github.io/forestsearch/
  • Function reference: organised across 16 topic areas (core algorithm, bootstrap, CV, visualization, simulation, MRCT, and more)

Citation

If you use forestsearch in your work, please cite:

@article{Leon2024,
  author  = {Le{\'o}n, Larry F. and Jemielita, Thomas and Guo, Zifang
             and Marceau West, Rachel and Anderson, Keaven M.},
  title   = {Exploratory subgroup identification in the heterogeneous
             {C}ox model: A relatively simple procedure},
  journal = {Statistics in Medicine},
  year    = {2024},
  doi     = {10.1002/sim.10163}
}

Related Work

  • Athey, S. & Imbens, G. (2016). Recursive partitioning for heterogeneous causal effects. PNAS.
  • Wager, S. & Athey, S. (2018). Estimation and inference of heterogeneous treatment effects using random forests. JASA.
  • Efron, B. (2014). Estimation and accuracy after model selection. JASA.

License

MIT © Larry F. Leon

Copy Link

Version

Install

install.packages('forestsearch')

Version

0.1.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Larry Leon

Last Published

March 23rd, 2026

Functions in forestsearch (0.1.0)

compare_detection_curves

Compare Detection Curves Across Sample Sizes
calculate_linear_predictors

Calculate Linear Predictors for Potential Outcomes
compute_detection_probability

Compute Probability of Detecting True Subgroup
calibrate_cens_adjust

Calibrate Censoring Adjustment to Match DGM Reference Distribution
calibrate_k_inter

Calibrate k_inter for Target Subgroup Hazard Ratio
compute_sg_hr_estimates

Compute Hazard Ratio Estimates for Subgroups
calculate_potential_hr

Calculate potential outcome hazard ratio
compute_detection_probability_single

Compute Detection Probability for Single Theta (Internal)
cox_ahr_cde_analysis

Comprehensive Wrapper for Cox Spline Analysis with AHR and CDE Plotting
compute_dgm_cde

Compute and Attach CDE Values to a DGM Object
compute_node_metrics

Compute node metrics for a policy tree
create_bootstrap_diagnostic_plots

Create Bootstrap Diagnostic Plots
compare_multiple_survreg

Compare Multiple Survival Regression Models
calculate_skewness

Calculate Skewness
compute_sg_hr

Compute Hazard Ratio for a Single Subgroup
build_estimation_table

Build Estimation Properties Table from Simulation Results
check_censoring_dgm

Diagnose Censoring Consistency Between DGM Source Data and Simulated Data
cox_cs_fit

Fit Cox Model with Cubic Spline for Treatment Effect Heterogeneity
create_bootstrap_caption

Calculate Bootstrap Table Caption
cox_summary_vectorized

Cox model summary for subgroup - vectorized version
ci_est

Confidence Interval for Estimate
create_dgm_for_mrct

Create Data Generating Mechanism for MRCT Simulations
compute_ahr

Compute AHR from loghr_po
cv_compare_results

Compare Multiple CV Results
create_summary_table_presentation

Preset: Presentation Table (Large Fonts)
count_boot_id

Count ID Occurrences in Bootstrap Sample
cut_var

Generate cut expressions for a variable
cut_size

Discretize Continuous Variable by Size Categories
compute_sg_summary

Compute Summary Statistics for Subgroups
create_grf_config

Helper Functions for GRF Subgroup Analysis
create_null_result

Create result object when no subgroup is found
create_forest_theme

Create Forest Plot Theme with Size Controls
create_sample_size_table

Create Sample Size Table for Multiple Scenarios
calculate_max_combinations

Calculate Maximum Combinations
cox_summary

Cox model summary for subgroup (OPTIMIZED)
create_factor_summary_tables

Create Factor Summary Tables from Bootstrap Results
create_reference_subgroup_columns

Create Reference Subgroup Indicator Columns
create_summary_table_publication

Preset: Publication-Ready Table
compute_cde

Compute CDE from theta_0 and theta_1
create_success_result

Create result object for successful subgroup identification
create_subgroup_indicator

Create Subgroup Indicator from Factor Definitions
cox_summary_batch

Batch Cox summaries with caching
create_result_row

Create Result Row
create_subgroup_summary_df

Create Subgroup Summary Data Frame for Forest Plot
extract_tree_cuts

Extract cut information from a policy tree
cv_summary_tables

Create Summary Tables from forestsearch_KfoldOut Results
create_summary_table

Create Enhanced Summary Table for Baseline Characteristics
default_sim_params

Default ForestSearch parameters (general)
default_grf_params_gen

Default GRF parameters (general)
cv_summary_text

Create Compact CV Summary Text
dummy_encode

Dummy-code a data frame (numeric pass-through, factors expanded)
extract_all_tree_cuts

Extract all cuts from fitted trees
create_fs_subgroup_indicators

Create Subgroup Indicator Columns from ForestSearch
early_stop_decision

Early Stopping Decision
cv_metrics_tables

Create Metrics Tables for Cross-Validation Results
fit_aft_model_spline

Fit AFT Model with Spline Treatment Effect
evaluate_subgroup_consistency

Evaluate Single Subgroup for Consistency (Fixed-Sample)
filter_by_lassokeep

Filter a vector by LASSO-selected variables
filter_call_args

Filter and merge arguments for function calls
default_fs_params

Default ForestSearch Parameters for GBSG Simulations
find_k_inter_for_target_hr

Find k_inter Value to Achieve Target Harm Subgroup Hazard Ratio
fit_aft_model_standard

Fit Standard AFT Model (Non-Spline)
forestsearch-package

forestsearch: Exploratory Subgroup Identification in Clinical Trials with Survival Endpoints
find_covariate_any_match

Find Covariate Any Match
figure_note

Generate Figure Note for Quarto/RMarkdown
create_gbsg_dgm

Create GBSG-Based AFT Data Generating Mechanism
cut_numeric

Discretize Continuous Variable into Quantile-Based Categories
default_grf_params

Default GRF Parameters for GBSG Simulations
define_subgroups

Define Subgroups with Flexible Cutpoints
create_timing_summary_table

Create Timing Summary Table
detect_variable_types

Automatically Detect Variable Types in a Dataset
density_threshold_integrand

Vectorized Density for Integration
extract_fs_estimates

Extract Estimates from ForestSearch Results
density_threshold_both

Bivariate Density for Split-Sample HR Threshold Detection
create_spline_variables

Create Spline Variables
create_summary_table_compact

Preset: Compact Table
create_summary_table_minimal

Preset: Minimal Table (No Highlighting, No Alternating)
find_required_sample_size

Find Minimum Sample Size for Target Detection Power
fit_cox_models

Fit Cox Models for Subgroups
fit_aft_model

Fit AFT Model with Optional Spline Treatment Effect
extract_fs_subgroup_definition

Extract Subgroup Definition from ForestSearch Object
forestsearch

ForestSearch: Exploratory Subgroup Identification
get_dfRes

Bootstrap Confidence Interval and Bias Correction Results
get_best_survreg

Get Best Model from Comparison
get_cut_name

Get variable name from cut expression
get_FSdata

ForestSearch Data Preparation and Feature Selection
fit_causal_forest

Fit causal survival forest
format_oc_results

Format Operating Characteristics Results as GT Table
format_results

Format results for subgroup summary
evaluate_consistency_twostage

Evaluate Consistency (Two-Stage Algorithm)
fit_cox_for_subgroup

Fit Cox Model for Subgroup
format_CI

Format Confidence Interval for Estimates
generate_complement_expression

Generate Complement Expression
format_bootstrap_diagnostics_table

Format Bootstrap Diagnostics Table with gt
plot.forestsearch

Plot ForestSearch Results
evaluate_comparison

Evaluate a Comparison Expression Without eval(parse())
evaluate_combination_with_status

Evaluate a Single Factor Combination with Status Tracking
evaluate_cuts_once

Cache and validate cut expressions efficiently
has_positive_variance

Check if Matrix Has Positive Variance
parse_sg_harm_to_expression

Parse sg.harm Factor Names to Expression
hrCI_format

Format Hazard Ratio and Confidence Interval
extract_selected_tree_cuts

Extract cuts from selected tree only
forestsearch_bootstrap_dofuture

ForestSearch Bootstrap with doFuture Parallelization
extract_grf_estimates

Extract Estimates from GRF Results
extract_idx_flagredundancy

Extract redundancy flag for subgroup combinations
forestsearch_tenfold

ForestSearch Repeated K-Fold Cross-Validation
extract_subgroup

Extract Subgroup Information
format_search_results

Format Search Results
generate_gbsg_bootstrap_general

Generate Synthetic GBSG Data using Generalized Bootstrap
generate_readable_sg_labels

Generate Readable Subgroup Labels from ForestSearch Object
format_subgroup_summary_tables

Format Subgroup Summary Tables with gt
generate_aft_dgm_flex

Generate Synthetic Survival Data using AFT Model with Flexible Subgroups
generate_bootstrap_synthetic

Generate Synthetic Data using Bootstrap with Perturbation
get_dfpred

Generate Prediction Dataset with Subgroup Treatment Recommendation
fit_policy_trees

Fit policy trees up to specified depth
find_leaf_split

Find the split that leads to a specific leaf node
prepare_subgroup_data

Prepare subgroup data for analysis
format_bootstrap_table

Format Bootstrap Results Table with gt
forestsearch_KfoldOut

ForestSearch K-Fold Cross-Validation Output Summary
format_continuous_definition

Format Continuous Variable Definition for Display
forestsearch_Kfold

ForestSearch K-Fold Cross-Validation
format_fs_details

Format ForestSearch Details Output for Beamer Two-Column Display
find_quantile_for_proportion

Find Quantile for Target Subgroup Proportion
print.fs_forest_theme

Print Method for ForestSearch Forest Theme
prepare_working_dataset

Prepare Working Dataset with Processed Covariates
gg_forest

ggplot2 / patchwork forest plot
run_simulation_analysis

Run One Simulation Replicate
print.fs_forestplot

Print Method for ForestSearch Forest Plot
remove_near_duplicate_subgroups

Remove Near-Duplicate Subgroups
grf.subg.eval

GRF Subgroup Evaluation and Performance Metrics
plot_sg_km

Plot Kaplan-Meier Survival Curves for Subgroups
generate_combination_indices

Generate Combination Indices
get_targetEst

Target Estimate and Standard Error for Bootstrap
grf.subg.harm.survival

GRF Subgroup Identification for Survival Data
generate_detection_curve

Generate Detection Probability Curve
generate_bootstrap_with_noise

Generate Bootstrap Sample with Added Noise
quick_km_band_plot

Quick Plot KM Bands from ForestSearch
get_dgm_hr

Extract HR from DGM (Backward Compatible)
plot_sg_results

Plot ForestSearch Subgroup Results
format_bootstrap_timing_table

Format Bootstrap Timing Table with gt
get_Cox_sg

Fit Cox Model for Subgroup
generate_super_population

Generate Super Population and Calculate Linear Predictors
km_summary

KM median summary for subgroup
sg_consistency_out

Output Subgroup Consistency Results
run_single_consistency_split

Run Single Consistency Split
get_bootstrap_exports

Get all exported functions from ForestSearch namespace
get_combinations_info

Get all combinations of subgroup factors up to maxk
plot_detection_curve

Plot Detection Probability Curve
plot_km_band_forestsearch

Plot Kaplan-Meier Survival Difference Bands for ForestSearch Subgroups
plot_subgroup_results_forestplot

Plot Subgroup Results Forest Plot
print_grf_details

Print detailed output for debugging
get_conf_force

Get forced cut expressions for variables
print_cv_params

Print CV ForestSearch Parameters
prepare_search_data

Prepare Data for Subgroup Search
prepare_censoring_model

Prepare Censoring Model Parameters
plot_subgroup_effects

Plot Subgroup Analysis Results
lasso_selection

LASSO selection for Cox model
sg_tables

Enhanced Subgroup Summary Tables (gt output)
summarize_bootstrap_events

Summarize Bootstrap Event Counts
interpret_estimation_table

Generate Narrative Interpretation of Estimation Properties
get_covs_in

Get indicator vector for selected subgroup factors
get_dgm_with_output

Create DGM with Output File Path
mrct_region_sims

MRCT Regional Subgroup Simulation
plot_sg_weighted_km

Plot Weighted Kaplan-Meier Curves for ForestSearch Subgroups
print.fs_tenfold

Print Method for Repeated K-Fold CV Results
print.fs_weighted_km

Print Method for fs_weighted_km Objects
n_pcnt

Calculate n and percent
plot_sg_summary_panel

Plot Summary Statistics Panel
summarize_bootstrap_results

Enhanced Bootstrap Results Summary
validate_k_inter_effect

Validate k_inter Effect on HR Heterogeneity
validate_inputs

Validate Input Parameters
remove_redundant_subgroups

Remove Redundant Subgroups
render_forestplot

Render ForestSearch Forest Plot
select_best_subgroup

Select best subgroup based on criterion
save_forestplot

Save ForestSearch Forest Plot to File
summarize_bootstrap_subgroups

Summarize Bootstrap Subgroup Analysis Results
summarize_factor_presence_robust

Summarize Factor Presence Across Bootstrap Subgroups
validate_spline_spec

Validate Spline Specification
validate_mrct_data

Validate Dataset for MRCT Simulations
safe_eval_expr

Evaluate an expression string in a data-frame scope
process_factor_vars

Process Factor Variables with Largest Value as Reference
process_factor_subgroup

Process Factor Variable for Subgroup Definition
subgroup.consistency

Evaluate Subgroup Consistency
subgroup.search

Subgroup Search for Treatment Effect Heterogeneity (Improved, Parallelized)
safe_subset

Subset a data frame using an expression string
get_param

Get Parameter with Default Fallback
get_split_hr_fast

Fast Cox Model HR Estimation
get_subgroup_membership

Get subgroup membership vector
summarize_simulation_results

Summarize Simulation Results
meets_event_criteria

Check Event Count Criteria
meets_prevalence_threshold

Check Prevalence Threshold
summarize_single_analysis

Summarize Single Analysis Results
print.fs_kfold

Print Method for K-Fold CV Results
plot.fs_forestplot

Plot Method for ForestSearch Forest Plot
is.continuous

Check if a variable is continuous
plot_spline_treatment_effect

Plot Spline Treatment Effect Function
plot_subgroup

Plot Subgroup Survival Curves
process_continuous_subgroup

Process Continuous Variable for Subgroup Definition
resolve_cv_parallel_args

Resolve Parallel Arguments for Cross-Validation
process_conf_force_expr

Process forced cut expression for a variable
plot.fs_sg_plot

Plot Method for fs_sg_plot Objects
sort_subgroups_preview

Sort Subgroups by Focus at consistency stage (consistency not available at this point)
is_flag_continuous

Check if cut expression is for a continuous variable (OPTIMIZED)
is_flag_drop

Check if cut expression should be dropped
setup_parallel_SGcons

Set up parallel processing for subgroup consistency
sort_subgroups

Sort Subgroups by Focus
process_continuous_vars

Process Continuous Variables
setup_gbsg_dgm

Set Up a GBSG-Based AFT Data Generating Mechanism
summary.cox_ahr_cde

Summary method for cox_ahr_cde objects
summary.forestsearch

Summary Method for forestsearch Objects
rmst_calculation

RMST calculation for subgroup
plot_sg_distribution

Plot Distribution of Identified Subgroups
plot_sg_forest

Plot Forest Plot of Hazard Ratios
print.fs_sg_plot

Print Method for fs_sg_plot Objects
process_cutpoint

Process Cutpoint Specification for Subgroup Definition
print.cox_ahr_cde

Print method for cox_ahr_cde objects
print.forestsearch

Print Method for forestsearch Objects
wilson_ci

Wilson Score Confidence Interval
print.gbsg_dgm

Print Method for gbsg_dgm Objects
qhigh

75th Percentile (Quantile High)
print.multi_survreg_comparison

Print method for survreg_comparison objects
render_reference_table

Render Reference Simulation Table as gt
resolve_bootstrap_parallel_args

Resolve parallel processing arguments for bootstrap
sens_text

Generate Cross-Validation Sensitivity Text
qlow

25th Percentile (Quantile Low)
run_forestsearch_analysis

Run ForestSearch Analysis
sensitivity_analysis_k_inter

Sensitivity Analysis of Hazard Ratios to k_inter
validate_grf_data

Validate input data for GRF analysis
simulate_from_dgm

Simulate Survival Data from AFT Data Generating Mechanism
simulate_from_gbsg_dgm

Simulate Trial Data from GBSG DGM
summaryout_mrct

Summary Tables for MRCT Simulation Results
run_grf_analysis

Run GRF Analysis
add_unprocessed_vars

Add Unprocessed Variables from Original Data
SG_tab_estimates

Subgroup summary table estimates
analyze_subgroup

Analyze subgroup for summary table (OPTIMIZED)
assemble_results

Assemble Final Results Object
add_id_column

Add ID Column to Data Frame
bootstrap_ystar

Bootstrap Ystar Matrix
SGplot_estimates

Violin/Boxplot Visualization of HR Estimates
build_classification_table

Build Classification Rate Table from Simulation Results
FS_labels

Convert Factor Code to Label
acm.disjctif

Disjunctive (dummy) coding for factor columns
bootstrap_results

Bootstrap Results for ForestSearch with Bias Correction
CV_sgs

Cross-Validation Subgroup Match Summary
apply_spline_constraint

Apply Spline Constraint to Treatment Effect Coefficients
assign_subgroup_membership

Assign data to subgroups based on selected node
calculate_hazard_ratios

Calculate Hazard Ratios from Potential Outcomes
build_cox_formula

Build Cox Model Formula
calculate_event_counts

Calculate Event Counts by Treatment Arm
calc_cov

Calculate Covariance for Bootstrap Estimates
calculate_counts

Calculate counts for subgroup summary