View source: R/simulation_tables.R
| build_classification_table | R Documentation |
Constructs a publication-quality gt table summarizing subgroup
identification and classification rates across one or more data generation
scenarios and analysis methods. The layout mirrors Table 4 of
Leon et al. (2024) with metrics grouped by model scenario (null / alt)
and columns for each analysis method.
build_classification_table(
scenario_results,
analyses = NULL,
digits = 2,
title = "Subgroup Identification and Classification Rates",
n_sims = NULL,
bold_threshold = 0.05,
font_size = 12,
subgroup_notation = c("harm", "benefit")
)
scenario_results |
Named list. Each element is itself a list with:
|
analyses |
Character vector of analysis labels to include
(e.g., |
digits |
Integer. Decimal places for proportions. Default: 2. |
title |
Character. Table title. Default:
|
n_sims |
Integer. Number of simulations (for subtitle). Default:
|
bold_threshold |
Numeric. Type I error threshold above which the
|
font_size |
Numeric. Font size in pixels for table text. Default: 12. Increase to 14 or 16 for larger display. |
subgroup_notation |
Character. |
For each scenario the function computes:
any(H): Proportion of simulations identifying any subgroup.
sens(H): Mean sensitivity (only under alternative).
sens(Hc): Mean specificity.
ppv(H): Mean positive predictive value (only under
alternative).
ppv(Hc): Mean negative predictive value.
avg|H|: Mean size of identified subgroup (when found).
Under the null hypothesis the rows are reduced to any(H),
sens(Hc), ppv(Hc), and avg|H|.
A gt table object.
format_oc_results,
summarize_simulation_results
## Not run:
# Assemble results from H0 and H1 simulations
scenarios <- list(
null = list(
results = results_null, label = "M1",
n_sample = 700, dgm = dgm_null, hypothesis = "null"
),
alt = list(
results = results_alt, label = "M1",
n_sample = 700, dgm = dgm_calibrated, hypothesis = "alt"
)
)
build_classification_table(scenarios, n_sims = 100)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.