View source: R/plot_subgroup_sims.R
| plot.subgroup_sims_summary | R Documentation |
Draws one of the vignettes' six forest panels from a
summary.subgroup_sims() object via gg_forest(): the empirical-CI
distribution of the HR point estimate or of the upper 95% bound
UB(HR), for the single-variable panel, the combination + random-
benchmark panel, or the high-risk panel (Pr(UB>=2) filter with the
ITT row anchored first).
## S3 method for class 'subgroup_sims_summary'
plot(
x,
metric = c("hr", "ub"),
panel = c("single", "combo", "highrisk"),
hr_true = x$hr_true,
base_size = 14,
point_size = 2.2,
line_size = 0.75,
widths = c(3.5, 5, 1.1, 1.2, 1.2, 1.1),
clip_marker = "arrow",
xlim = NULL,
ticks_at = NULL,
xlab = NULL,
footnote = NULL,
...
)
x |
A |
metric |
|
panel |
|
hr_true |
True hazard ratio for the reference/vertical line and
footnotes; defaults to the value stored on |
base_size, point_size, line_size |
Passed to |
widths |
Column width vector passed to |
clip_marker |
Passed to |
xlim, ticks_at, xlab, footnote |
|
... |
Further arguments merged over the defaults and passed to
|
Defaults reproduce the committed vignette figures exactly:
metric-specific axis limits, tick positions, reference/vertical line
styling, the four annotation columns (N plus tail probabilities and
the unconditional median), and the panel-specific footnotes. Any
default can be overridden through the named arguments or ...,
which is merged over the assembled argument list before the
gg_forest() call (so e.g. ref_col = "black" or
widths = ... in ... win).
Summaries carrying effect metadata (the generic path of
summary.subgroup_sims(), e.g. from subgroup_glm() fits) take a
scale-aware branch instead: identity-scale measures (MD) plot with
xlog = FALSE and the null line at 0, ratio-scale measures (OR)
with xlog = TRUE and the null line at 1, and both delegate
limits/ticks to gg_forest()'s data-driven defaults (the HR panel
constants can hide binary medians and remain available via
xlim=/ticks_at=); annotation
columns and footnotes are built from the resolved labels and
threshold strings (legacy literals preserved when a pair equals the
legacy pair), and columns for disabled (NA) thresholds are dropped
(the default widths shrink to match; an explicit widths is used
as given). hr_true is interpreted on the fitter's estimate scale
throughout. Legacy summaries produce byte-identical gg_forest()
calls.
The gg_forest() plot object.
forest_height(), summary.subgroup_sims()
## Not run:
S <- summary(sims_uniform, hr_true = 0.70)
plot(S, metric = "ub", panel = "combo")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.