Enhanced Bootstrap Results Summary
Source:R/summarize_bootstrap_results.R
summarize_bootstrap_results.RdCreates 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
sgharmelement containing factor definitionsList with
sg.harm_labelelement (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_tabare 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 bydigitsinforestsearch_bootstrap_dofuture) is at least as high asdigitsrequested here. Setdigits = NULLto display the construction-time strings unchanged. Thenandn1columns are not reformatted – their count-with-percent format is preserved as constructed.
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()
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.
See also
format_bootstrap_table for table creation
sg_tables for analogous main analysis tables
summarize_bootstrap_subgroups for subgroup stability analysis
Examples
if (FALSE) { # \dontrun{
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
} # }