% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{exitprob_mams}
\alias{exitprob_mams}
\title{Exit Probabilities for Multi-Arm Multi-Stage Design}
\usage{
exitprob_mams(
  M = NA_integer_,
  r = 1,
  theta = NA_real_,
  corr_known = TRUE,
  kMax = NA_integer_,
  b = NULL,
  a = NULL,
  I = NULL
)
}
\arguments{
\item{M}{Number of active treatment arms.}

\item{r}{Randomization ratio of each active arm to the common control.}

\item{theta}{A vector of length \eqn{M} representing the true treatment
effects for each active arm versus the common control.}

\item{corr_known}{Logical. If \code{TRUE}, the correlation between Wald
statistics is derived from the randomization ratio \eqn{r}
as \eqn{r / (r + 1)}. If \code{FALSE}, a conservative correlation of
0 is used.}

\item{kMax}{Number of sequential looks.}

\item{b}{A vector of efficacy boundaries for the max-Z statistics.}

\item{a}{A vector of futility boundaries for the max-Z statistics.}

\item{I}{A vector of information levels for any active arm versus the
common control.}
}
\value{
A vector \code{exitProb} of length \code{kMax} containing the
probability of rejection at each look.
}
\description{
Computes the exit (rejection) probabilities for a multi-arm
multi-stage design.
}
\details{
The function assumes a multivariate normal distribution for the Wald
statistics and all active arms share the same information level.
}
\examples{

# Setup: 2 active arms vs control and 3 sequential looks.

# Information levels: equal spacing over 3 looks based on a maximum of
# 95 patients per arm, SD = 1.0
I <- 95 / (2 * 1.0^2) * seq(1, 3)/3

# O'Brien-Fleming critical values
b <- c(3.886562, 2.748214, 2.243907)

# Type I error under the global null hypothesis
p0 <- exitprob_mams(M = 2, theta = c(0, 0), kMax = 3, b = b, I = I)
cumsum(p0$exitProbUpper)

# Power under alternative: Treatment effects of 0.3 and 0.5
p1 <- exitprob_mams(M = 2, theta = c(0.3, 0.5), kMax = 3, b = b, I = I)
cumsum(p1$exitProbUpper)

}
\references{
Ping Gao, Yingqiu Li.
Adaptive multiple comparison sequential design (AMCSD) for clinical trials.
Journal of Biopharmaceutical Statistics, 2024, 34(3), 424-440.
}
\author{
Kaifeng Lu, \email{kaifenglu@gmail.com}
}
