View source: R/compare_selection_rules.R
| extract_selected_subgroups | R Documentation |
Reduces a forestsearch_comparison object to a tidy
data.frame with one row per combo, summarizing each configuration's
selected subgroup. Intended for post-hoc aggregation across
analyses (e.g.\ side-by-side summary of a continuous-outcome
comparison and a binary-outcome comparison in a single document).
extract_selected_subgroups(x, analysis_label = NULL)
x |
A |
analysis_label |
Optional character scalar identifying the
parent analysis (e.g.\ |
A data.frame with columns:
analysisIf analysis_label is supplied;
otherwise omitted.
comboInteger index, 1..n_combos.
combo_labelPretty label (e.g.\
"effMaxSG / pareto").
sg_focus, selection_ruleThe two comparison axes.
outcome_type, effect_measureRecorded
per row from fs$outcome_type /
fs$effect_measure, so mixed-effect-measure runs
remain comparable.
subgroupSelected subgroup definition –
NA_character_ if no subgroup was identified;
otherwise paste(fs$sg.harm, collapse = " & ").
N_H, N_HcSample sizes in the harm
subgroup H (treat.recommend == 0) and its complement
Hc.
effectThe winner's effect estimate on the
natural scale (\exp applied to the stored
hr column for ratio-scale measures
OR/RR/IRR; passed through otherwise).
PconsThe winner's consistency probability.
KNumber of factors in the winner's subgroup definition.
n_passedNumber of candidates that passed
consistency (= nrow(out_sg$result)).
on_frontierLogical – did the selected
subgroup lie on the Pareto frontier? NA when the
frontier is unavailable.
errorThe error message for failed combos
(NA_character_ on success).
## Not run:
cmp_cont <- compare_selection_rules(...) # continuous analysis
cmp_bin <- compare_selection_rules(...) # binary analysis
tidy_cont <- extract_selected_subgroups(cmp_cont, analysis_label = "continuous")
tidy_bin <- extract_selected_subgroups(cmp_bin, analysis_label = "binary")
all_selected <- rbind(tidy_cont, tidy_bin)
saveRDS(all_selected, "selected_subgroups_all.rds")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.