Plot the Pareto Frontier of Candidate Subgroups
Source:R/plot_pareto_frontier.R
plot_pareto_frontier.RdProduces a 2D scatter of candidate subgroups in (effect, N) space,
with the Pareto frontier drawn as a step polyline and the selected
subgroup highlighted. When ci_table is supplied (the return
value of compute_frontier_cis), horizontal error bars
for the split-derived 95\
Usage
plot_pareto_frontier(
fs,
ci_table = NULL,
show_band = FALSE,
effect_neighborhood = NULL,
label_members = TRUE,
point_size = 3,
xlim = NULL,
xlim_trim = NULL
)Arguments
- fs
A
forestsearchresult object.- ci_table
Optional
data.tablefromcompute_frontier_cis. When supplied, horizontal error bars depict the split-derived 95\ DefaultNULL(no error bars).- show_band
Logical. If
TRUEandsg_focusis"hrMaxSG"or"hrMinSG", shade the effect-size neighborhood band on the right of the plot. DefaultFALSE.- effect_neighborhood
Numeric. Override of the band width; default
NULL, which uses the value from the originalforestsearchcall (or0.10if not recoverable).- label_members
Logical. If
TRUE, label each frontier member with its short cut description. DefaultTRUE.- point_size
Numeric. Size of frontier-member points. Default
3.- xlim
Optional numeric vector of length 2 controlling the x-axis range, e.g.\
c(0.5, 3). By default the axis auto-expands to include split-CI bars when supplied, which can make individual points look crowded. Pass an explicitxlim(or usexlim_trim = TRUE) to zoom in.- xlim_trim
Logical or
NULL. IfTRUE(andxlimisNULL), the x-axis is trimmed to the range of frontier point estimates with a small padding, ignoring CI bars. IfNULL(default), auto-decides:TRUEwhen the effect measure is on a ratio (log) scale ("OR","RR","IRR"), where wide split-CI tails on the natural scale routinely dwarf the point-estimate range and force the axis to span orders of magnitude;FALSEotherwise. PassTRUEorFALSEexplicitly to override the auto behavior.
Details
The frontier polyline is drawn as a downward step from large-effect
/ small-N candidates to small-effect / large-N candidates. Points
off the frontier (if any are present in the fs$grp.consistency$out_sg$result
table beyond those on the frontier) are not currently plotted; this
function only displays the frontier and its selected member.
For sg_focus = "hrMinSG", the selected subgroup may not lie
on the Pareto frontier (the focus deliberately prefers small
subgroups, which are typically N-dominated). In that case the
selected marker appears off the polyline.
Examples
if (FALSE) { # \dontrun{
p <- plot_pareto_frontier(fs)
print(p)
# With split-derived 95% CIs:
ci_tab <- compute_frontier_cis(fs, n_splits = 1000)
p2 <- plot_pareto_frontier(fs, ci_table = ci_tab)
print(p2)
} # }