Skip to contents

Draws the probabilities that the Go criterion is met under scenario_go and that the NoGo criterion is met under scenario_nogo against the number of subjects in the treatment group, with the targets (dashed lines, one gray line when the two targets are equal) and the smallest candidate that meets them (dotted line). The vertical axis runs from 0 to the largest probability or target, so that small probabilities can be read. scenario_go is a scenario under which a Go decision would be wrong and scenario_nogo one under which a NoGo decision would be wrong, so the legend calls the two probabilities those of a false Go and a false NoGo.

Usage

# S3 method for class 'qdm_n_search'
plot(
  x,
  col_go = "#658D1B",
  col_nogo = "#D91E49",
  linewidth = 1,
  point_size = 1.5,
  base_size = 11,
  legend_position = "bottom",
  ...
)

Arguments

x

An object of class "qdm_n_search".

col_go, col_nogo

Colors of the probabilities and targets of the Go and NoGo criteria.

linewidth

Width of the lines, in the units of the linewidth aesthetic of ggplot2.

point_size

Size of the points, in millimeters.

base_size

Base font size of ggplot2::theme_bw(), in points.

legend_position

Position of the legend: "bottom" (the default), "top", "left", "right" or "none".

...

Not used; arguments given here are ignored with a warning.

Value

A ggplot object.

Examples

des <- design_binary(
  n_t = 12, n_c = 12,
  prior_t = prior_beta(0.5, 0.5), prior_c = prior_beta(0.5, 0.5),
  criterion = criterion_posterior(theta_tv = 0.2, theta_mav = 0.1,
                                  gamma_go = 0.5, gamma_nogo = 0.8)
)
res <- qdm_find_n(des, data.frame(pi_t = 0.4, pi_c = 0.4),
                  data.frame(pi_t = 0.7, pi_c = 0.4), target_go = 0.1,
                  target_nogo = 0.1, n_t = seq(6, 30, by = 2))
plot(res)