efftox_contour_plot: Plot EffTox utility contours

View source: R/efftox_contour_plot.R

efftox_contour_plotR Documentation

Plot EffTox utility contours

Description

Plot EffTox utility contours. The probability of efficacy is on the x-axis and toxicity on the y-axis. The zero-utility curve is plotted bolder. The three "hinge points" are plotted as blue triangles. Optional Prob(Efficacy) vs Prob(Toxicity) points can be added; these are shown as red numerals, enumerated in the order provided.

Usage

efftox_contour_plot(
  fit,
  use_ggplot = FALSE,
  prob_eff = fit$prob_eff,
  prob_tox = fit$prob_tox,
  num_points = 1000,
  util_vals = seq(-3, 3, by = 0.2)
)

Arguments

fit

An instance of efftox_fit.

use_ggplot

logical, TRUE to use ggplot2. Defaults to FALSE to use standard R graphics.

prob_eff

vector of numbers between 0 and 1, containing the efficacy probabilities of extra points to add to the plot as points, e.g. the posterior mean efficacy probabilities of the doses under investigation. Paired with prob_tox, thus they should be the same length. Defaults to the values fitted by the model. Use NULL to supress.

prob_tox

vector of numbers between 0 and 1, containing the toxicity probabilities of extra points to add to the plot as points, e.g. the posterior mean toxicity probabilities of the doses under investigation. Paired with prob_eff, thus they should be the same length. Defaults to the values fitted by the model. Use NULL to supress.

num_points

integer for number of points to calculate on each curve. The default is 1000 and this should be plenty.

util_vals

A contour is plotted for each of these utility values. The default is contours spaced by 0.2 between from -3 and 3, i.e. seq(-3, 3, by = 0.2).

Value

if use_ggplot = TRUE, an instance of ggplot; else no object is returned. Omit assignment in either case to just view the plot.

See Also

stan_efftox

Examples

fit <- stan_efftox_demo(outcome_str = '1N 2E 3B')
efftox_contour_plot(fit)
title('EffTox utility contours')
# The same with ggplot2
efftox_contour_plot(fit, use_ggplot = TRUE) +
                    ggplot2::ggtitle('EffTox utility contours')


trialr documentation built on April 1, 2023, 12:03 a.m.