
Plot Method for pbayesdecisionprob2bin Objects
Source:R/plot.pbayesdecisionprob2bin.R
plot.pbayesdecisionprob2bin.RdDisplays operating characteristics for two-binary-endpoint results returned
by pbayesdecisionprob2bin.
Usage
# S3 method for class 'pbayesdecisionprob2bin'
plot(
x,
which = "Go",
title = NULL,
xlab = NULL,
ylab = NULL,
col_go = "#658D1B",
col_nogo = "#D91E49",
col_gray = "#939597",
base_size = 28,
...
)Arguments
- x
An object of class
pbayesdecisionprob2bin.- which
A character string specifying which decision probability to plot. Must be one of
"Go","Gray","NoGo","all", or"overlay". Default is"Go".- title
A character string for the plot title. Defaults to
NULL(no title displayed).- xlab
A character string or expression for the x-axis label. Defaults to
NULL, which auto-generates a label based ondesign.- ylab
A character string or expression for the y-axis label. Defaults to
NULL, which auto-generates a label based ondesign.- col_go
A character string specifying the high-end fill colour for the Go probability gradient. Default is
"#658D1B".- col_nogo
A character string specifying the high-end fill colour for the NoGo probability gradient. Default is
"#D91E49".- col_gray
A character string specifying the high-end fill colour for the Gray probability gradient. Default is
"#939597".- base_size
A positive numeric scalar specifying the base font size (in points) passed to
theme_bw(). Default is28.- ...
Further arguments passed to or from other methods (ignored).
Details
When the input scenarios form a regular grid over
(pi_t1, pi_t2) (i.e., every combination of the unique values of
pi_t1 and pi_t2 is present) and rho_t is constant,
the function produces a filled tile plot: each panel (Go, Gray,
NoGo) is coloured by its own probability on a continuous gradient (white to
the panel colour), so intensity directly reflects the probability magnitude.
A solid white contour line is overlaid at the corresponding decision
threshold (gamma_go for the Go panel, gamma_nogo for the
NoGo panel, and their mean for the Gray panel) to mark the boundary where
the probability equals the threshold. Otherwise the function falls back to
a scatter plot in which point colour encodes the decision
probability on a continuous scale.
When which = "all", the three panels are arranged side-by-side using
gridExtra::grid.arrange, so each panel retains its own independent
colour scale. This requires the gridExtra package.
For design = 'controlled' or design = 'external', both axes
are expressed as treatment-minus-control differences:
\(\theta_1 = \pi_{t1} - \bar{\pi}_{c1}\) and
\(\theta_2 = \pi_{t2} - \bar{\pi}_{c2}\),
where \(\bar{\pi}_{c1}\) and \(\bar{\pi}_{c2}\) are the means of the
supplied pi_c1 and pi_c2 vectors.
For design = 'uncontrolled', the axes represent \(\pi_{t1}\) and
\(\pi_{t2}\) directly.
Vertical and horizontal reference lines are drawn at the decision thresholds:
When
prob = 'posterior': vertical lines at \(\theta_{TV1}\) and \(\theta_{MAV1}\) (x-axis) and horizontal lines at \(\theta_{TV2}\) and \(\theta_{MAV2}\) (y-axis).When
prob = 'predictive': a single vertical line at \(\theta_{NULL1}\) and a single horizontal line at \(\theta_{NULL2}\).