% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot.R
\name{plot_twostage_2arm_bf}
\alias{plot_twostage_2arm_bf}
\title{Plot an optimal two-stage two-arm Bayes factor design}
\usage{
plot_twostage_2arm_bf(
  res,
  main = "Optimal two-stage two-arm Bayes factor design"
)
}
\arguments{
\item{res}{A list returned by \code{optimal_twostage_2arm_bf()}, containing
components \code{$design}, \code{$naive_oc}, \code{$occ} and \code{$priors}.}

\item{main}{Character string with the main title of the plot.}
}
\value{
Invisibly returns \code{NULL}; called for its side effect of
producing a plot.
}
\description{
Given the result from \code{optimal_twostage_2arm_bf()}, this function
produces a six-panel base R plot showing the design schematic, operating
characteristics, and the design and analysis priors under \eqn{H_0} and
\eqn{H_1}.
}
\examples{
res <- optimal_twostage_2arm_bf(
  alpha = 0.10, beta = 0.20, k = 1/3, k_f = 3,
  n1_min = c(3, 3), n2_max = c(8, 8),
  alloc1 = 0.5, alloc2 = 0.5,
  power_cushion = 0,
  interim_fraction = c(0.5, 0.5),
  grid_step = 1,
  progress = FALSE,
  max_iter = 16,
  test = "BF01",
  a_0_d = 1, b_0_d = 1,
  a_0_a = 1, b_0_a = 1,
  a_1_d = 1, b_1_d = 1,
  a_2_d = 1, b_2_d = 1,
  a_1_a = 1, b_1_a = 1,
  a_2_a = 1, b_2_a = 1
)
if (is.numeric(res$design) && length(res$design) == 4 && !anyNA(res$design)) {
  plot_twostage_2arm_bf(res)
}
}
