Plot a fitted model
**Warning**: these methods are at an experimental stage of development, and may change with future releases.
Plotting methods for blrmfit and blrm_trial objects.
plot_toxicity_curve plots continuous profiles of the dose-toxicity curve.
plot_toxicity_intervals plots the posterior probability mass in
subintervals of [0,1].
plot_toxicity_curve(
object,
newdata,
x,
group,
xlim,
ylim,
transform,
prob,
prob_outer,
size,
alpha,
facet_args = list(),
hline_at,
grid_length
)
plot_toxicity_intervals(
object,
newdata,
x,
group,
interval_prob,
interval_max_mass,
ewoc_colors
)
## Default S3 method:
plot_toxicity_curve(
object,
newdata,
x,
group,
xlim,
ylim,
transform = TRUE,
prob = 0.5,
prob_outer = 0.95,
size = 0.75,
alpha = 1,
facet_args = list(),
hline_at = c(0.16, 0.33),
grid_length = 100
)
## S3 method for class 'blrm_trial'
plot_toxicity_curve(
object,
newdata,
x,
group,
xlim,
ylim,
transform = TRUE,
prob = 0.5,
prob_outer = 0.95,
size = 0.75,
alpha = 1,
facet_args = list(),
hline_at = c(0.16, 0.33),
grid_length = 100
)
## Default S3 method:
plot_toxicity_intervals(
object,
newdata,
x,
group,
interval_prob = c(0, 0.16, 0.33, 1),
interval_max_mass = c(NA, NA, 0.25),
ewoc_colors = c("green", "red")
)
## S3 method for class 'blrm_trial'
plot_toxicity_intervals(
object,
newdata,
x,
group,
interval_prob,
interval_max_mass,
ewoc_colors = c("green", "red")
)object |
fitted model object |
newdata |
optional data frame specifying for what to predict;
if missing, then the data of the input model |
x |
Character giving the parameter name to be mapped to the x-axis. This also supports 'tidy' parameter selection by specifying 'x = vars(...)', where '...' is specified the same way as in [dplyr::select(...)][dplyr::select] and similar functions. Examples of using 'x' in this way can be found in the examples. |
group |
Grouping variable(s) whose levels will be mapped to different facets of the plot. 'group' can be a character vector, tidy parameter(s) of the form 'group = vars(...)', or a formula to be passed directly to [ggplot2::facet_wrap]. |
xlim |
x-axis limits |
ylim |
y-axis limits on the probability scale |
transform |
logical (defaults to |
prob |
central probability mass to report for the inner ribbon, i.e. the quantiles 0.5-prob/2 and 0.5+prob/2 are displayed. |
prob_outer |
central probability mass to report for the outer ribbon, i.e. the quantiles 0.5-prob/2 and 0.5+prob/2 are displayed. |
alpha, size |
Arguments passed to geoms. For this plot, |
facet_args |
A named list of arguments (other than 'facets') passed to [ggplot2::facet_wrap()]. |
hline_at |
Location(s) of horizontal guide lines (passed to [bayesplot::hline_at]). |
grid_length |
Number of grid points within |
interval_prob |
defines the interval probabilities reported in
the standard outputs. Defaults to |
interval_max_mass |
vector defining for each interval of
the |
ewoc_colors |
Fill colors used for bars indicating EWOC OK or not.
Vector of two characters, each of which must correspond to
|
Plots the dose-toxicity curve, with P(DLT) on the vertical axis and dose of "drug_name_x" on the horizontal.
A ggplot object that can be further customized using the **ggplot2** package.
## Setting up dummy sampling for fast execution of example
## Please use 4 chains and 100x more warmup & iter in practice
.user_mc_options <- options(OncoBayes2.MC.warmup=10, OncoBayes2.MC.iter=20, OncoBayes2.MC.chains=1)
library(dplyr) # for vars()
example_model("combo2")
plot_toxicity_curve(blrmfit,
x = vars(drug_A),
group = ~ group_id * drug_B,
newdata = filter(dose_info_combo2, group_id == "trial_AB"),
facet_args = list(ncol = 4))
plot_toxicity_intervals(blrmfit,
x = vars(drug_A),
group = ~ group_id * drug_B,
newdata = filter(dose_info_combo2, group_id == "trial_AB"))
## Recover user set sampling defaults
options(.user_mc_options)Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.