% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sl.sim.R
\name{sl.sim}
\alias{sl.sim}
\title{Dose-finding simulations for a list of scenarios}
\usage{
sl.sim(decTable, file, header = TRUE, sep = ",", ...)
}
\arguments{
\item{decTable}{A customized decision table in the same format as the output
of \code{\link{dec.table}}.}

\item{file}{The name of the file containing the scenario definitions. See
\code{\link{read.table}} for details.}

\item{header}{Logical; if \code{TRUE}, the file contains variable names in
the first line. See \code{\link{read.table}} for details.}

\item{sep}{The field separator character. Defaults to \code{","}. See
\code{\link{read.table}} for details.}

\item{...}{Additional arguments passed to \code{\link{read.table}}.}
}
\value{
An object of class \code{"dec.sim"} (for one scenario) or
  \code{"sl.sim"} (for multiple scenarios). Use \code{\link{summary}} to
  obtain and print a summary 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 each trial.}
  \item{n.patients}{The average number of patients treated 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 for one or more scenarios read from a file.
}
\details{
In each row of the input file, the parameters must be ordered as
  \code{start.level}, \code{nsim}, and \code{truep}. The
  dose-finding algorithm is described in \code{\link{dec.sim}}.
}
\examples{
dt <- dec.table(0.6,0.4,0.2,0.3,c(3,3,3))
test.file <- system.file("extdata", "testS.csv", package = "tsdf")
# use a customized decision table
table.file <- system.file("extdata", "decTable.csv", package = "tsdf")
dec <- read.csv(table.file, row.names = 1, check.names = FALSE)
out1 <- sl.sim(as.matrix(dt$table), test.file)
out2 <- sl.sim(dec, test.file)
}
\author{
Wenchuan Guo <wguo1017@gmail.com>
}
