plot.dec.sim: Plot simulation results from a "dec.sim" object

View source: R/utility.R

plot.dec.simR Documentation

Plot simulation results from a "dec.sim" object

Description

Available plot types are: true toxicity at each dose level (type = "s"); a bar plot of the probability of selecting each dose as the MTD (type = "prob"); a bar plot of the average number of patients treated at each dose level (type = "np"); and a bar plot of the average number of DLTs at each dose level (type = "dlt"). Setting type = "all" produces all four plots.

Usage

## S3 method for class 'dec.sim'
plot(
  x,
  pt,
  s = 1,
  type = c("all", "s", "prob", "np", "dlt"),
  label = TRUE,
  col = "cornflowerblue",
  text.col = "darkblue",
  cex = 1,
  ...
)

Arguments

x

An object of class "dec.sim" or "sl.sim", returned by dec.sim or sl.sim.

pt

A vector of target toxicity values, one for each scenario.

s

The scenario to plot. Defaults to 1.

type

Plot type. See the description above.

label

Logical; if TRUE, values are displayed on the plot.

col

Graphical parameter col; see par.

text.col

Color used for text labels.

cex

Graphical parameter cex; see par.

...

Arguments passed to plotting functions.

Examples

# generate decision table
dt <- dec.table(0.6,0.4,0.2,0.3,c(3,3,3))
# Simulate trials from test data
test.file <- system.file("extdata", "testS.csv", package = "tsdf")
out <- sl.sim(dt$table, test.file)
plot(out, pt=rep(0.3,2), s=1, type="all")
plot(out, pt=rep(0.3,2), s=2, type="prob")
plot(out, pt=rep(0.3,2), s=1, type="np")
plot(out, pt=rep(0.3,2), s=2, type="dlt")

tsdf documentation built on April 26, 2026, 1:06 a.m.