% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{getBound_seamless}
\alias{getBound_seamless}
\title{Efficacy Boundaries for Phase 2/3 Seamless Design}
\usage{
getBound_seamless(
  M = NA_integer_,
  r = 1,
  corr_known = TRUE,
  k = NA_integer_,
  informationRates = NA_real_,
  alpha = 0.025,
  typeAlphaSpending = "sfOF",
  parameterAlphaSpending = NA_real_,
  userAlphaSpending = NA_real_,
  spendingTime = NA_real_,
  efficacyStopping = NA_integer_
)
}
\arguments{
\item{M}{Number of active treatment arms in Phase 2.}

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

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

\item{k}{The index of the current look in Phase 3.}

\item{informationRates}{A numeric vector of information rates up to the
current look. Values must be strictly increasing and \eqn{\le 1}.}

\item{alpha}{The significance level. Defaults to 0.025.}

\item{typeAlphaSpending}{The type of alpha spending. One of the following:
\code{"OF"} for O'Brien-Fleming boundaries,
\code{"P"} for Pocock boundaries,
\code{"WT"} for Wang & Tsiatis boundaries,
\code{"sfOF"} for O'Brien-Fleming type spending function,
\code{"sfP"} for Pocock type spending function,
\code{"sfKD"} for Kim & DeMets spending function,
\code{"sfHSD"} for Hwang, Shi & DeCani spending function,
\code{"user"} for user defined spending, and
\code{"none"} for no early efficacy stopping.
Defaults to \code{"sfOF"}.}

\item{parameterAlphaSpending}{The parameter value for the alpha spending.
Corresponds to \eqn{\Delta} for \code{"WT"}, \eqn{\rho} for \code{"sfKD"},
and \eqn{\gamma} for \code{"sfHSD"}.}

\item{userAlphaSpending}{The user defined alpha spending. Cumulative alpha
spent up to each stage.}

\item{spendingTime}{A numeric vector of length \eqn{k+1} specifying the
error spending time at each analysis. Values must be strictly increasing
and \eqn{\le 1}. If omitted, defaults to \code{informationRates}.}

\item{efficacyStopping}{Indicators of whether efficacy stopping is allowed
at each stage. Defaults to \code{TRUE} if left unspecified.}
}
\value{
A numeric vector of length \eqn{k + 1} containing the critical
values (on the standard normal Z-scale) for each analysis up to the
current look.
}
\description{
Calculates the efficacy stopping boundaries for a phase 2/3
seamless design, accounting for the selection of the best arm
at the end of Phase 2 and sequential testing in Phase 3.
}
\details{
The function determines critical values by solving for the boundary that
satisfies the alpha-spending requirement, given the selection of the
"best" arm at the end of Phase 2.

If \code{typeAlphaSpending} is \code{"OF"}, \code{"P"}, \code{"WT"}, or
\code{"none"}, then \code{informationRates}, \code{efficacyStopping},
and \code{spendingTime} must be of full length \code{kMax}, and
\code{informationRates} and \code{spendingTime} must end with 1.
}
\examples{

# Determine O'Brien-Fleming boundaries for a seamless design with
# 2 active arms in Phase 2 and 2 looks in Phase 3 (3 looks total).
getBound_seamless(M = 2, k = 2, informationRates = seq(1, 3)/3,
                  alpha = 0.025, typeAlphaSpending = "OF")

}
\references{
Ping Gao, Yingqiu Li.
Adaptive two-stage seamless sequential design for clinical trials.
Journal of Biopharmaceutical Statistics, 2025, 35(4), 565-587.
}
\author{
Kaifeng Lu, \email{kaifenglu@gmail.com}
}
