% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{getCP_seamless}
\alias{getCP_seamless}
\title{Conditional Power for Phase 2/3 Seamless Design}
\usage{
getCP_seamless(
  INew = NA_real_,
  M = NA_integer_,
  r = 1,
  corr_known = TRUE,
  L = NA_integer_,
  zL = NA_real_,
  theta = NA_real_,
  IMax = NA_real_,
  K = NA_integer_,
  informationRates = NA_real_,
  efficacyStopping = NA_integer_,
  futilityStopping = NA_integer_,
  criticalValues = NULL,
  alpha = 0.025,
  typeAlphaSpending = "sfOF",
  parameterAlphaSpending = NA_real_,
  userAlphaSpending = NA_real_,
  futilityBounds = NULL,
  futilityCP = NULL,
  futilityTheta = NULL,
  spendingTime = NA_real_,
  MullerSchafer = FALSE,
  kNew = NA_integer_,
  informationRatesNew = NA_real_,
  efficacyStoppingNew = NA_integer_,
  futilityStoppingNew = NA_integer_,
  typeAlphaSpendingNew = "sfOF",
  parameterAlphaSpendingNew = NA_real_,
  futilityBoundsInt = NULL,
  futilityCPInt = NULL,
  futilityThetaInt = NULL,
  typeBetaSpendingNew = "none",
  parameterBetaSpendingNew = NA_real_,
  spendingTimeNew = NA_real_
)
}
\arguments{
\item{INew}{The maximum information for the active arm versus the common
control in the secondary trial.}

\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 used.}

\item{L}{The interim adaptation look in Phase 3.}

\item{zL}{The z-test statistic at the interim adaptation look of
Phase 3.}

\item{theta}{The assumed treatment effect for the selected arm versus the
common control.}

\item{IMax}{Maximum information for the active arm versus the common
control for the original trial. Must be provided.}

\item{K}{Number of sequential looks in Phase 3.}

\item{informationRates}{A numeric vector of information rates fixed
before the trial. If unspecified, defaults to \eqn{(1:(K+1)) / (K+1)}.}

\item{efficacyStopping}{Indicators of whether efficacy stopping is
allowed at each stage of the primary trial. Defaults to \code{TRUE}
if left unspecified.}

\item{futilityStopping}{Indicators of whether futility stopping is
allowed at each stage of the primary trial. Defaults to true
if left unspecified.}

\item{criticalValues}{The upper boundaries on the max z-test statistic
scale for Phase 2 and the z-test statistics for the selected arm
in Phase 3 for the primary trial. If missing, boundaries
will be computed based on the specified alpha spending function.}

\item{alpha}{The significance level of the primary trial.
Defaults to 0.025.}

\item{typeAlphaSpending}{The type of alpha spending for the primary
trial. 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 of alpha spending
for the primary trial. 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 for the
primary trial. Represents the cumulative alpha spent up to each stage.}

\item{futilityBounds}{The lower boundaries on the  max z-test statistic
scale for Phase 2 and the z-test statistics for the selected arm
in Phase 3 for the primary trial.}

\item{futilityCP}{The conditional power-based futility bounds for the
primary trial.}

\item{futilityTheta}{The parameter value-based futility bounds for the
primary trial.}

\item{spendingTime}{The error spending time of the primary trial.
Defaults to missing, in which case it is assumed to be the same as
\code{informationRates}.}

\item{MullerSchafer}{Whether to use the Muller and Schafer (2001) method
for trial adaptation.}

\item{kNew}{The number of looks of the secondary trial.}

\item{informationRatesNew}{The spacing of looks of the secondary trial.}

\item{efficacyStoppingNew}{The indicators of whether efficacy stopping is
allowed at each look of the secondary trial. Defaults to \code{TRUE}
if left unspecified.}

\item{futilityStoppingNew}{The indicators of whether futility stopping is
allowed at each look of the secondary trial. Defaults to true
if left unspecified.}

\item{typeAlphaSpendingNew}{The type of alpha spending for the secondary
trial. 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, and
\code{"none"} for no early efficacy stopping.
Defaults to \code{"sfOF"}.}

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

\item{futilityBoundsInt}{The futility boundaries on the z statistic
scale for new stages of the integrated trial.}

\item{futilityCPInt}{The conditional power-based futility bounds for
new stages of the integrated trial.}

\item{futilityThetaInt}{The parameter value-based futility bounds for the
new stages of the integrated trial.}

\item{typeBetaSpendingNew}{The type of beta spending for the secondary
trial. One of the following:
\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, and
\code{"none"} for no early futility stopping.
Defaults to \code{"none"}.}

\item{parameterBetaSpendingNew}{The parameter value of beta spending
for the secondary trial. Corresponds to \eqn{\rho} for \code{"sfKD"},
and \eqn{\gamma} for \code{"sfHSD"}.}

\item{spendingTimeNew}{The error spending time of the secondary trial.
Defaults to missing, in which case it is assumed to be the same as
\code{informationRatesNew}.}
}
\value{
A vector of two conditional powers given the interim results and
parameter values, one without design change and the other with
data-dependent design changes.
}
\description{
Obtains the conditional power for specified incremental
information given the interim results, parameter values, and
data-dependent changes in the error spending function, as well as the
number and spacing of interim looks.
}
\examples{

getCP_seamless(
  INew = 198 / 4, M = 2, r = 1, corr_known = FALSE,
  L = 1, zL = -log(0.67) * sqrt(80 / 4), theta = -log(0.691),
  IMax = 120 / 4, K = 2, informationRates = c(1/3, 2/3, 1),
  alpha = 0.025, typeAlphaSpending = "OF", kNew = 1)

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