View source: R/compare_fs_subgroups.R
| compare_fs_subgroups | R Documentation |
Cross-tabulates subgroup assignments from two analyses and produces
a formatted gt summary table with concordance statistics.
Accepts forestsearch result objects, GRF result lists, or raw
indicator vectors. Non-detection (no subgroup found) is handled
automatically: all subjects are classified to the complement.
compare_fs_subgroups(
fs1,
fs2,
label1 = "Analysis 1",
label2 = "Analysis 2",
id.name = NULL,
sg0_label = NULL,
sg1_label = NULL,
subgroup_notation = c("harm", "benefit"),
title = "Subgroup Membership Comparison",
subtitle = NULL,
font_size = 12
)
fs1 |
Either a |
fs2 |
Same types as |
label1 |
Character. Display label for the first analysis. |
label2 |
Character. Display label for the second analysis. |
id.name |
Character. Subject ID column for merge alignment.
Only used when both inputs are result objects.
If |
sg0_label |
Character or |
sg1_label |
Character or |
subgroup_notation |
Character. |
title |
Character. Table title. |
subtitle |
Character or |
font_size |
Numeric. Font size for gt table. |
A list with:
A gt cross-tabulation table.
The raw cross-tabulation matrix.
Agreement, kappa, counts.
Per-subject assignments from both analyses.
## Not run:
# Harm search: Cox vs Poisson (both forestsearch objects)
result <- compare_fs_subgroups(fs_cox, fs_pois,
label1 = "Cox PH", label2 = "Poisson",
subgroup_notation = "harm")
# Benefit search: FS vs GRF (handles non-detection automatically)
result <- compare_fs_subgroups(fs_result, grf_result,
label1 = "ForestSearch", label2 = "GRF",
subgroup_notation = "benefit")
# Raw vectors
result <- compare_fs_subgroups(
c(rep(0L, 30), rep(1L, 70)),
c(rep(0L, 25), rep(1L, 75)),
label1 = "Method A", label2 = "Method B")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.