% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dec.sim.R
\name{dec.sim}
\alias{dec.sim}
\title{Run dose-finding simulations}
\usage{
dec.sim(truep, decTable, start.level = 1, nsim = 1000)
}
\arguments{
\item{truep}{A vector of length \eqn{k}, giving the true toxicity
probabilities for the dose levels under study.}

\item{decTable}{A customized decision table in the same format as the output
of \code{\link{dec.table}}.}

\item{start.level}{Starting dose level. Defaults to 1, the lowest dose
level.}

\item{nsim}{Number of simulated trials. Defaults to 1000.}
}
\value{
An object of class \code{"dec.sim"}. Use
  \code{\link{summary.dec.sim}} to obtain and print a summary table of the
  results. The returned object is a list containing:
  \item{mtd}{A vector of dose levels giving the recommended maximum
  tolerated dose (MTD) at the end of the trial.}
  \item{mtd.prob}{A vector of length \eqn{k} giving the proportion of trials
  that selected each dose level as the MTD.}
  \item{over.prob}{A vector of length \eqn{k} giving the proportion of
  trials that selected each dose level as above the MTD.}
  \item{n.patients}{The average number of patients treated at each dose
  level.}
  \item{dlt}{The average number of DLTs observed at each dose level.}
  \item{truep}{The input true toxicity probabilities.}
  \item{start.level}{The input starting dose level.}
  \item{nsim}{The input number of simulated trials.}
}
\description{
Run dose-finding simulations based on a customized decision
  table.
}
\details{
Assume there are \eqn{d} dose levels to be studied. Let
  \eqn{n_i} and \eqn{m_i} denote the cumulative number of patients treated
  and the cumulative number of DLTs observed at the current dose level,
  respectively. Let \eqn{n_{max}} be the maximum number of patients allowed
  at each dose level. The procedure is as follows:
\describe{
\item{Step 1}{Update the cumulative numbers of DLTs (\eqn{m_i}) and
total treated patients (\eqn{n_i}) at the current dose, then use the
decision table to choose an action. If the decision is \code{"S"}, go to
Step 2. If the decision is \code{"D"} or \code{"DU"}, go to Step 3. If the
decision is \code{"E"}, go to Step 4.}
\item{Step 2}{If \eqn{n_i = n_{max}}, declare dose \eqn{i} as the MTD.
Otherwise, treat an additional cohort at the current dose and return to
Step 1.}
\item{Step 3}{If the current dose is the lowest dose, stop the trial and
declare that the MTD is below the lowest dose. Otherwise, if the next lower
dose has not yet reached \eqn{n_{max}}, treat an additional cohort there,
move to that dose, and return to Step 1. If the next lower dose has already
reached \eqn{n_{max}}, stop the trial and declare that dose as the MTD. If
the decision is \code{"DU"}, record the current dose as unusable and do not
treat additional patients there.}
\item{Step 4}{If the current dose is the highest dose, stop the trial and
declare that the MTD is above the highest dose. Otherwise, if the next
higher dose has been marked \code{"DU"}, continue treating the current dose
until it reaches \eqn{n_{max}}; if that limit is reached, declare the
current dose as the MTD. If the next higher dose is available and has not
yet reached \eqn{n_{max}}, treat an additional cohort there, move up to
that dose, and return to Step 1. Otherwise, declare the current dose as the
MTD.}
}
}
\examples{
truep <- c(0.3, 0.45, 0.5, 0.6)
res <- dec.table(0.6,0.4,0.2,0.3,c(3,3,3))
out <- dec.sim(truep, as.matrix(res$table), start.level = 2, nsim = 1000)
summary(out, pt = 0.3)
}
\author{
Wenchuan Guo <wguo1017@gmail.com>
}
