View source: R/summarize_bootstrap_subgroups.R
| summarize_bootstrap_subgroups | R Documentation |
Comprehensive tabulation of bootstrap subgroup identification results
including basic statistics, factor frequencies, consistency
distributions, GRF-cut frequencies, and agreement with the original
analysis subgroup. Returns raw data.table tabulations
suitable for custom post-processing, export, or plotting; for the
full formatted pipeline (gt tables, diagnostics, plots) call
summarize_bootstrap_results instead.
summarize_bootstrap_subgroups(results, nb_boots, original_sg = NULL, maxk = 2)
results |
Data.table or data.frame. Bootstrap results with subgroup characteristics including columns like Pcons, hr_sg, N_sg, K_sg, and M.1-M.k |
nb_boots |
Integer. Total number of bootstrap iterations |
original_sg |
Character vector. Original subgroup definition from main analysis (e.g., c("{age>=50}", "{nodes>=3}") for a 2-factor subgroup) |
maxk |
Integer. Maximum number of factors allowed in subgroup definition |
List with summary components:
Data.table of summary statistics
Data.table of Pcons distribution by bins
(columns Consistency Range, Count, Percent =
100 * Count / n_found). The bins are closed on the left:
a label "a-b" holds a <= Pcons < b (for example
"0.85-0.95" holds 0.85 <= Pcons < 0.95),
"<0.5" holds Pcons < 0.5, and the top bin
">=0.95" holds 0.95 <= Pcons <= 1. A value on a
break counts in the bin that starts there (0.95 is in
">=0.95").
Data.table of subgroup size distribution
(columns Size Range, Count, Percent), with
bins closed on the left in the same way: "<50" holds
N_sg < 50, "50-99" holds 50 <= N_sg < 100,
and so on to ">=300", which holds N_sg >= 300.
Data.table of factor frequencies by position
Data.table of subgroup definition agreement counts
Data.table of base factor presence counts
Data.table of specific factor definitions
Data.table of GRF policy-tree cut frequencies
across all bootstrap iterations (not just successful ones).
Columns: Rank, grf_cut, N,
Percent. NULL when results lacks the
grf_cuts_b column (pre-Phase-C objects). Unlike
subgroup-related tables, this tabulation is NOT restricted
to iterations that identified a subgroup – it spans all
bootstraps so that the analyst can distinguish "GRF produced
no cut" from "GRF produced a cut that consistency rejected".
Data.table comparing to original analysis subgroup
Integer. Number of successful iterations
Numeric. Percentage of successful iterations
summarize_bootstrap_results for the full
formatted summary pipeline (gt tables plus diagnostics and plots).
forestsearch_bootstrap_dofuture to run the bootstrap
analysis that produces the results object consumed here.
## Not run:
# Run bootstrap analysis
boot_out <- forestsearch_bootstrap_dofuture(fs.est, nb_boots = 500)
# Raw tabulations for custom post-processing
subg <- summarize_bootstrap_subgroups(
results = boot_out$results,
nb_boots = 500,
original_sg = fs.est$sg.harm,
maxk = 2L
)
# Inspect the GRF cut frequencies across all bootstraps
subg$grf_cut_freq
# Export factor frequencies to CSV for an external report
data.table::fwrite(subg$factor_freq, "factor_freq.csv")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.