% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{getCI}
\alias{getCI}
\title{Confidence Interval After Trial Termination}
\usage{
getCI(
  L = NA_integer_,
  zL = NA_real_,
  IMax = NA_real_,
  informationRates = NA_real_,
  efficacyStopping = NA_integer_,
  criticalValues = NA_real_,
  alpha = 0.025,
  typeAlphaSpending = "sfOF",
  parameterAlphaSpending = NA_real_,
  spendingTime = NA_real_
)
}
\arguments{
\item{L}{The termination look.}

\item{zL}{The z-test statistic at the termination look.}

\item{IMax}{The maximum information of the trial.}

\item{informationRates}{The information rates up to look \code{L}.}

\item{efficacyStopping}{Indicators of whether efficacy stopping is
allowed at each stage up to look \code{L}.
Defaults to true if left unspecified.}

\item{criticalValues}{The upper boundaries on the z-test statistic scale
for efficacy stopping up to look \code{L}.}

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

\item{typeAlphaSpending}{The type of alpha spending for the 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{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{spendingTime}{The error spending time up to look \code{L}.
Defaults to missing, in which case, it is the same as
\code{informationRates}.}
}
\value{
A data frame with the following components:
\itemize{
\item \code{pvalue}: p-value for rejecting the null hypothesis.
\item \code{thetahat}: Median unbiased point estimate of the parameter.
\item \code{cilevel}: Confidence interval level.
\item \code{lower}: Lower bound of confidence interval.
\item \code{upper}: Upper bound of confidence interval.
}
}
\description{
Obtains the p-value, median unbiased point estimate, and
confidence interval after the end of a group sequential trial.
}
\details{
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{

# group sequential design with 90\% power to detect delta = 6
delta <- 6
sigma <- 17
n <- 282
(des1 <- getDesign(IMax = n/(4*sigma^2), theta = delta, kMax = 3,
                   alpha = 0.05, typeAlphaSpending = "sfHSD",
                   parameterAlphaSpending = -4))

# crossed the boundary at the second look
L <- 2
n1 <- n*2/3
delta1 <- 7
sigma1 <- 20
zL <- delta1/sqrt(4/n1*sigma1^2)

# confidence interval
getCI(L = L, zL = zL, IMax = n/(4*sigma1^2),
      informationRates = c(1/3, 2/3), alpha = 0.05,
      typeAlphaSpending = "sfHSD", parameterAlphaSpending = -4)

}
\references{
Anastasios A. Tsiatis, Gary L. Rosner and Cyrus R. Mehta.
Exact confidence intervals following a group sequential test.
Biometrics 1984;40:797-803.
}
\author{
Kaifeng Lu, \email{kaifenglu@gmail.com}
}
