summarize_bootstrap_results: Enhanced Bootstrap Results Summary

View source: R/summarize_bootstrap_results.R

summarize_bootstrap_resultsR Documentation

Enhanced Bootstrap Results Summary

Description

Creates comprehensive output including formatted table with subgroup footnote, diagnostic plots, bootstrap quality metrics, and detailed timing analysis.

Usage

summarize_bootstrap_results(
  sgharm,
  boot_results,
  create_plots = FALSE,
  est.scale = "hr",
  digits = 2
)

Arguments

sgharm

The selected subgroup object from forestsearch results. Can be:

  • Character vector of factor definitions (e.g., c("{age>=50}", "{nodes>=3}"))

  • List with sgharm element containing factor definitions

  • List with sg.harm_label element (human-readable labels)

boot_results

List. Output from forestsearch_bootstrap_dofuture()

create_plots

Logical. Generate diagnostic plots (default: FALSE)

est.scale

Character. "hr" or "1/hr" for effect scale

digits

Integer or NULL. Decimal places for display formatting of numeric columns in the rendered table (per-arm summaries, Diff, effect estimate CI, bias-corrected CI). Default 2. When set, the formatted strings in boot_results$FSsg_tab are parsed back to numeric and re-formatted at the requested precision; this works reliably as long as the construction-time precision (default 4 decimals; controlled by digits in forestsearch_bootstrap_dofuture) is at least as high as digits requested here. Set digits = NULL to display the construction-time strings unchanged. The n and n1 columns are not reformatted – their count-with-percent format is preserved as constructed.

Details

The table output includes a footnote displaying the identified subgroup definition, analogous to the tab_estimates table from sg_tables. This is achieved by extracting the subgroup definition from sgharm and passing it to format_bootstrap_table.

Value

List with components:

table

gt table with treatment effects and subgroup footnote

diagnostics

List of bootstrap quality metrics

diagnostics_table_gt

gt table of diagnostics

plots

List of ggplot2 diagnostic plots (if create_plots=TRUE)

timing

List of timing analysis (if timing data available)

subgroup_summary

List from summarize_bootstrap_subgroups()

See Also

format_bootstrap_table for table creation sg_tables for analogous main analysis tables summarize_bootstrap_subgroups for subgroup stability analysis

Examples

## Not run: 
library(survival)
df <- survival::gbsg
df$grade3 <- as.integer(df$grade == "3")
fs <- forestsearch(df,
  confounders.name = c("age", "meno", "size", "grade3", "nodes", "pgr", "er"),
  outcome.name = "rfstime", treat.name = "hormon", event.name = "status")
fs_bc <- forestsearch_bootstrap_dofuture(fs, nb_boots = 100)
summaries <- summarize_bootstrap_results(fs$sg.harm, fs_bc)
summaries$table

## End(Not run)

forestsearch documentation built on Nov. 15, 2026, 9:06 a.m.